[hackers] [scc] Set field of struct are lvalues || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 13 Aug 2015 23:39:59 +0200 (CEST)

commit 84847138062fe977c49c7dc838d8421ed2064822
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Aug 13 23:38:03 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Aug 13 23:38:03 2015 +0200

    Set field of struct are lvalues
    
    The lvalue flag was not set in the node when a field was implied.
    We have to do some additional test here, because not all the structure
    field can be a lvalue, but it is first approach.

diff --git a/cc1/expr.c b/cc1/expr.c
index c223a44..e76d8ac 100644
--- a/cc1/expr.c
+++ b/cc1/expr.c
_AT_@ -607,6 +607,7 @@ field(Node *np)
                         error("incorrect field in struct/union");
                 next();
                 np = node(OFIELD, sym->type, np, NULL);
+ np->lvalue = 1;
                 np->sym = sym;
                 return np;
         default:
Received on Thu Aug 13 2015 - 23:39:59 CEST

This archive was generated by hypermail 2.3.0 : Thu Aug 13 2015 - 23:48:11 CEST