Reset current_storage when resetting current_symtab.

This helps prevent an internal error caused by ealier errors.
This commit is contained in:
Bill Currie 2012-12-22 20:04:11 +09:00
parent 85387e02cf
commit ff4b232d92
1 changed files with 20 additions and 3 deletions

View File

@ -271,12 +271,29 @@ external_def_list
: /* empty */
{
current_symtab = pr.symtab;
current_storage = sc_global;
}
| external_def_list external_def
| external_def_list obj_def
| error END { current_class = 0; yyerrok; current_symtab = pr.symtab; }
| error ';' { yyerrok; current_symtab = pr.symtab; }
| error '}' { yyerrok; current_symtab = pr.symtab; }
| error END
{
yyerrok;
current_class = 0;
current_symtab = pr.symtab;
current_storage = sc_global;
}
| error ';'
{
yyerrok;
current_symtab = pr.symtab;
current_storage = sc_global;
}
| error '}'
{
yyerrok;
current_symtab = pr.symtab;
current_storage = sc_global;
}
;
external_def