scc

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

commit 65279cc59e7e5ee4c64be38923608cc552ec74d6
parent f93cb9bc73732b8af7db62172406de5a08be4b30
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri,  4 Sep 2015 18:30:29 +0200

Fix lvalue in varnode()

Functions and arrays are not lvalues.

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

diff --git a/cc1/code.c b/cc1/code.c @@ -409,10 +409,11 @@ Node * varnode(Symbol *sym) { Node *np; + Type *tp = sym->type; np = node(OSYM, sym->type, NULL, NULL); np->type = sym->type; - np->lvalue = 1; + np->lvalue = tp->op != FTN && tp->op != ARY; np->constant = 0; np->symbol = 1; np->sym = sym;