Make struct decls actually work.

find_type() does type comparisons based on tag name for struct/union/enum
but when it returns the previous tag (eg, from "struct foo;") the returned
type has a null symtab pointer, so setting the symtab pointer in the type
before calling find_type() only throws away the symtab. Thus, since
find_type() doesn't check the symtab pointer when comparing the types, set
the symtab pointer after calling find_type().
This commit is contained in:
Bill Currie 2011-02-13 20:56:12 +09:00
parent acced90101
commit a19b7ec8f9

View file

@ -129,8 +129,8 @@ build_struct (int su, symbol_t *tag, symtab_t *symtab, type_t *type)
symtab->size = size;
}
}
sym->type = find_type (sym->type); // checks the tag, not the symtab
sym->type->t.symtab = symtab;
sym->type = find_type (sym->type);
return sym;
}