[hackers] [scc] Fix lvalue in varnode() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 4 Sep 2015 20:22:39 +0200 (CEST)

commit 65279cc59e7e5ee4c64be38923608cc552ec74d6
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Sep 4 18:30:29 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Sep 4 18:30:29 2015 +0200

    Fix lvalue in varnode()
    
    Functions and arrays are not lvalues.

diff --git a/cc1/code.c b/cc1/code.c
index 50eb838..492caa9 100644
--- a/cc1/code.c
+++ b/cc1/code.c
_AT_@ -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;
Received on Fri Sep 04 2015 - 20:22:39 CEST

This archive was generated by hypermail 2.3.0 : Fri Sep 04 2015 - 20:24:16 CEST