scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit ffe766e4bd6d01ff1a8498e63cffca21ca50eab9
parent 2b7e1beeced12f7553789848e55c97f857811bb7
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 24 Apr 2014 14:49:59 +0200

Free labels when function ends

Diffstat:
Msymbol.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/symbol.c b/symbol.c @@ -33,7 +33,7 @@ freesyms(uint8_t ns) static struct symtab *tbl; register Symbol *sym; - tbl = &symtab[ns]; + tbl = &symtab[(ns >= NR_NAMESPACES) ? NS_IDEN : ns]; for (sym = tbl->head; sym; sym = sym->next) { if (sym->ctx <= curctx) break; @@ -56,6 +56,8 @@ context(Ctxfun *fun, Symbol *lbreak, Symbol *lcont, Symbol *lswitch) freesyms(NS_IDEN); freesyms(NS_TAG); + if (curctx == CTX_OUTER) + freesyms(NS_LABEL); } Symbol *