Create the symbol for the struct as early as possible.

This commit is contained in:
Bill Currie 2011-02-13 20:55:33 +09:00
parent b545f72f93
commit acced90101

View file

@ -491,6 +491,10 @@ enumerator
struct_specifier struct_specifier
: STRUCT optional_tag '{' : STRUCT optional_tag '{'
{ {
symbol_t *sym;
sym = find_struct ($1, $2, 0);
if (!sym->table)
symtab_addsymbol (current_symtab, sym);
current_symtab = new_symtab (current_symtab, stab_local); current_symtab = new_symtab (current_symtab, stab_local);
} }
struct_defs '}' struct_defs '}'