From d183cb32df59de77d8080e417eb2fe7ebcc64949 Mon Sep 17 00:00:00 2001 From: Jun Woong Date: Tue, 10 Mar 2015 08:59:47 +0900 Subject: [PATCH] Fixed the result of unary + to generate rvalue --- src/expr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/expr.c b/src/expr.c index 36739fc6..0dfcc2ee 100755 --- a/src/expr.c +++ b/src/expr.c @@ -157,9 +157,11 @@ static Tree unary(void) { p->u.sym->addressed = 1; break; case '+': t = gettok(); p = unary(); p = pointer(p); - if (isarith(p->type)) - p = cast(p, promote(p->type)); - else + if (isarith(p->type)) { + p = cast(p, promote(p->type)); + if (generic(p->op) == INDIR) + p = tree(RIGHT, p->type, NULL, p); + } else typeerror(ADD, p, NULL); break; case '-': t = gettok(); p = unary(); p = pointer(p); if (isarith(p->type)) {