aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-07 20:49:10 +0200
committerlemon <lsof@mailbox.org>2022-08-07 20:49:10 +0200
commit8c6a876e9ff39789cbd2fc8b73abd3549928ba89 (patch)
tree0432140beabcaa70a09e355689294001c5bbb465 /bootstrap
parent2c5faaed4a0e37dc63cedad03290383b1ba0057d (diff)
infer in assignment exprs
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",