scc

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

commit 089ee27ee2b410c3cd74d81089e8889a7c891e7e
parent 391e7cf76385ab57add8fc39c8d0d380eedb6db8
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat, 26 Sep 2015 19:19:55 +0200

Rewrite defmacro()

After the change in the implementation of the symbol table is
needed to call te install to have the symbol installed in
the table, but before that patch it was only needed calling to
lookup().

Diffstat:
Mcc1/cpp.c | 8+-------
1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/cc1/cpp.c b/cc1/cpp.c @@ -26,13 +26,7 @@ int disexpand; static Symbol * defmacro(char *s) { - Symbol *sym; - - strcpy(yytext, s); - sym = lookup(NS_CPP, yytext); - /* FIXME: We have a problem here */ - sym->flags |= ISDECLARED; - return sym; + return install(NS_CPP, lookup(NS_CPP, s)); } void