From d13019290ee2e7f41369f1d31ce903efd26cfd05 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 19 Feb 2019 12:18:27 -0800 Subject: Check that left hand side of assignment expression is an lvalue --- expr.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'expr.c') diff --git a/expr.c b/expr.c index 11d6fbe..aad7cbc 100644 --- a/expr.c +++ b/expr.c @@ -841,6 +841,8 @@ assignexpr(struct scope *s) default: return l; } + if (!(l->flags & EXPRFLAG_LVAL)) + error(&tok.loc, "left side of assignment expression is not an lvalue"); next(); r = assignexpr(s); lvalueconvert(r); -- cgit v1.2.3