diff --git a/src/language.yacc b/src/language.yacc index f9f622ec37f49f5ab0575e8669d8fb6ebf00a0f0..93bd2015511a6163cca317778c686e490aac85a8 100644 --- a/src/language.yacc +++ b/src/language.yacc @@ -110,7 +110,7 @@ /* This is the grammar definition of Pike. */ #include "global.h" -RCSID("$Id: language.yacc,v 1.210 2000/09/05 02:18:12 hubbe Exp $"); +RCSID("$Id: language.yacc,v 1.211 2000/09/05 19:33:24 grubba Exp $"); #ifdef HAVE_MEMORY_H #include <memory.h> #endif @@ -928,7 +928,7 @@ new_arg_name: type7 optional_dot_dot_dot optional_identifier } if($3->u.sval.u.string->len && - islocal($3->u.sval.u.string) >= 0) + islocal($3->u.sval.u.string) >= 0) my_yyerror("Variable '%s' appears twice in argument list.", $3->u.sval.u.string->str); @@ -3315,14 +3315,19 @@ int low_add_local_name(struct compiler_frame *frame, struct pike_string *type, node *def) { - int tmp=islocal(str); - if(tmp >= frame->last_block_level) - { - if(str->size_shift) - my_yyerror("Duplicate local variable, previous declaration on line %d\n", - frame->variable[tmp].line); - else - my_yyerror("Duplicate local variable '%s', previous declaration on line %d\n",STR0(str),frame->variable[tmp].line); + if (str->len) { + int tmp=islocal(str); + if(tmp >= frame->last_block_level) + { + if(str->size_shift) + my_yyerror("Duplicate local variable, " + "previous declaration on line %d\n", + frame->variable[tmp].line); + else + my_yyerror("Duplicate local variable '%s', " + "previous declaration on line %d\n", + STR0(str), frame->variable[tmp].line); + } } debug_malloc_touch(def);