shithub: scc

Download patch

ref: ffe766e4bd6d01ff1a8498e63cffca21ca50eab9
parent: 2b7e1beeced12f7553789848e55c97f857811bb7
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Apr 24 10:49:59 EDT 2014

Free labels when function ends

--- a/symbol.c
+++ b/symbol.c
@@ -33,7 +33,7 @@
 	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 @@
 
 	freesyms(NS_IDEN);
 	freesyms(NS_TAG);
+	if (curctx == CTX_OUTER)
+		freesyms(NS_LABEL);
 }
 
 Symbol *