scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit a47da4831e6000e825decbeb876cfc604082d41f
parent 051206f55c018f7f9b7660cb444c554f568df348
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 16 Nov 2014 06:13:26 -0500

Undefined structs at the end of the context

Types are never deleted, because it is expensive delete them, and usually
they have file scope. This approach has a problem with structures, because
it means that a structure type is always defined even when the original
type is no longer valid.

Diffstat:
cc1/symbol.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/cc1/symbol.c b/cc1/symbol.c @@ -40,6 +40,8 @@ freesyms(uint8_t ns) break; if (ns == NS_LABEL && !sym->s.isdefined) error("label '%s' is not defined", sym->name); + if (ns == NS_TAG) + sym->type->defined = 0; tbl->htab[hash(sym->name)] = sym->hash; next = tbl->head = sym->next; free(sym->name);