shithub: scc

Download patch

ref: 84847138062fe977c49c7dc838d8421ed2064822
parent: 49ea14f17cb76c7112691a4ed951315f3d105c63
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Aug 13 19:38:03 EDT 2015

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.

--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -607,6 +607,7 @@
 			error("incorrect field in struct/union");
 		next();
 		np = node(OFIELD, sym->type, np, NULL);
+		np->lvalue = 1;
 		np->sym = sym;
 		return np;
 	default: