aboutsummaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'expr.c')
-rw-r--r--expr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/expr.c b/expr.c
index aad7cbc..46d81e8 100644
--- a/expr.c
+++ b/expr.c
@@ -473,6 +473,7 @@ postfixexpr(struct scope *s, struct expression *r)
if (!p && !t->func.isvararg && t->func.paraminfo)
error(&tok.loc, "too many arguments for function call");
*end = assignexpr(s);
+ lvalueconvert(*end);
if (!t->func.isprototype || (t->func.isvararg && !p))
*end = exprconvert(*end, typeargpromote((*end)->type));
else
@@ -585,17 +586,20 @@ unaryexpr(struct scope *s)
case TADD:
next();
e = castexpr(s);
+ lvalueconvert(e);
e = exprconvert(e, typeintpromote(e->type));
break;
case TSUB:
next();
e = castexpr(s);
+ lvalueconvert(e);
e = exprconvert(e, typeintpromote(e->type));
e = mkbinaryexpr(&tok.loc, TSUB, mkconstexpr(&typeint, 0), e);
break;
case TBNOT:
next();
e = castexpr(s);
+ lvalueconvert(e);
e = exprconvert(e, typeintpromote(e->type));
e = mkbinaryexpr(&tok.loc, TXOR, e, mkconstexpr(e->type, -1));
break;