ref: fca65d578482bb75a341943d97153e8b5f87a457
parent: c61a84d918f0978ebb8e1abdba5e24aa1a97f916
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Apr 10 02:35:03 EDT 2014
Update lvalue flag in cast() An expression after a cast is an lvalue only if the expression before of the cast was a lvalue.
--- a/expr.c
+++ b/expr.c
@@ -225,6 +225,7 @@
cast(void)
{
Type *tp;
+ Node *np1, *np2;
extern Type *typename(void);
if (yytoken == '(') {
@@ -233,7 +234,10 @@
next();
tp = typename();
expect(')');
- return castcode(cast(), tp);
+ np1 = cast();
+ np2 = castcode(np1, tp);
+ np2->b.lvalue = np1->b.lvalue;
+ return np1;
default:
break;
}