scc

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

commit cd6d1548bbb6365822d9b690bb85b2b582778b2e
parent 1e7ba5eee9a86e4e113959c95fca5129727b6d48
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat, 23 May 2015 07:01:46 +0200

Do not unlink non hashable symbols

There are temporal symbols, which are not part of the hash system,
so it is an error to remove them from the hash table.

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

diff --git a/cc1/symbol.c b/cc1/symbol.c @@ -53,7 +53,8 @@ popctx(void) } else if (sym->ns == NS_TAG) { sym->type->defined = 0; } - htab[hash(sym->name)] = sym->hash; + if (sym->hash) + htab[hash(sym->name)] = sym->hash; free(sym->name); free(sym); }