aboutsummaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'expr.c')
-rw-r--r--expr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/expr.c b/expr.c
index 1e49e4f..903aef8 100644
--- a/expr.c
+++ b/expr.c
@@ -972,7 +972,8 @@ unaryexpr(struct scope *s)
error(&tok.loc, "operand of unary '-' operator must have arithmetic type");
if (e->type->prop & PROPINT)
e = exprpromote(e);
- e = mkbinaryexpr(&tok.loc, TSUB, mkconstexpr(&typeint, 0), e);
+ e = mkexpr(EXPRUNARY, e->type, e);
+ e->op = op;
break;
case TBNOT:
next();