shithub: scc

Download patch

ref: 65279cc59e7e5ee4c64be38923608cc552ec74d6
parent: f93cb9bc73732b8af7db62172406de5a08be4b30
author: Roberto E. Vargas Caballero <[email protected]>
date: Fri Sep 4 14:30:29 EDT 2015

Fix lvalue in varnode()

Functions and arrays are not lvalues.

--- a/cc1/code.c
+++ b/cc1/code.c
@@ -409,10 +409,11 @@
 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;