shithub: scc

Download patch

ref: 8f9b01e50962ab00b65267732fac13960e312cc1
parent: e83f4e7c1597b0647aab5d8bd05cf8ef25a32e24
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed May 27 11:16:34 EDT 2015

Create symbols in nextsym as undeclared

newsym() returns declared symbols (mainly because
they are needed for tags), but when nextsym is used
the returned sym must be an unitialized symbol.

--- a/cc1/symbol.c
+++ b/cc1/symbol.c
@@ -152,6 +152,7 @@
 			return sym;
 	}
 	new = newsym(ns);
+	new->flags &= ~ISDEFINED;
 	new->name = xstrdup(yytext);
 	new->hash = sym->hash;
 	return sym->hash = new;