aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap')
-rw-r--r--bootstrap/parse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bootstrap/parse.c b/bootstrap/parse.c
index 5019c50..2b44ca8 100644
--- a/bootstrap/parse.c
+++ b/bootstrap/parse.c
@@ -1658,7 +1658,10 @@ pexassign(struct parser *P) {
ex = pexcond(P);
if (P->used_targty) return ex;
if ((oret = matchassignop(P, &tok))) {
- struct expr rhs = pexcond(P);
+ struct expr rhs;
+ if (oret == 1)
+ P->targty = ex.ty;
+ rhs = pexcond(P);
if (!islvalue(&ex))
fatal(P, ex.span,
"left operand to assignment operator %T is not an lvalue",