mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Ensure structs get added to the symbol table.
This commit is contained in:
parent
a4eaa2a89b
commit
4420a7125e
1 changed files with 11 additions and 2 deletions
|
@ -464,14 +464,23 @@ struct_specifier
|
|||
}
|
||||
struct_defs '}'
|
||||
{
|
||||
symbol_t *sym;
|
||||
symtab_t *symtab = current_symtab;
|
||||
current_symtab = symtab->parent;
|
||||
|
||||
$$ = make_spec (build_struct ($1, $2, symtab, 0)->type, 0, 0);
|
||||
sym = build_struct ($1, $2, symtab, 0);
|
||||
$$ = make_spec (sym->type, 0, 0);
|
||||
if (!sym->table)
|
||||
symtab_addsymbol (current_symtab, sym);
|
||||
}
|
||||
| STRUCT tag
|
||||
{
|
||||
$$ = make_spec (find_struct ($1, $2, 0)->type, 0, 0);
|
||||
symbol_t *sym;
|
||||
|
||||
sym = find_struct ($1, $2, 0);
|
||||
$$ = make_spec (sym->type, 0, 0);
|
||||
if (!sym->table)
|
||||
symtab_addsymbol (current_symtab, sym);
|
||||
}
|
||||
;
|
||||
|
||||
|
|
Loading…
Reference in a new issue