From 3e27b6426011dfda8cc79672f2c821ae2ac12726 Mon Sep 17 00:00:00 2001 From: Teddy Date: Sat, 5 Apr 2014 08:32:17 +0800 Subject: ... --- semantics.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/semantics.c b/semantics.c index e6fdced..ab802aa 100644 --- a/semantics.c +++ b/semantics.c @@ -838,7 +838,7 @@ ExpType exp_check_sizeof(ExpType op1, CNode *ast) { return op1; } -ExpType exp_check_preinc(ExpType op1, CNode *ast) { +ExpType exp_check_inc(ExpType op1, CNode *ast) { if (!IS_SCALAR(op1.type->type)) { sprintf(err_buff, "wrong type argument to increment/decrement"); @@ -1020,6 +1020,9 @@ ExpType exp_check_postfix(CNode *p, CScope_t scope) { op1.lval = 1; } break; + case OPT_INC: case OPT_DEC: + exp_check_inc(op1, p); + break; default: assert(0); } return op1; @@ -1141,7 +1144,7 @@ ExpType semantics_exp(CNode *p, CScope_t scope) { res = exp_check_scalar(op1, p); break; case OPT_INC: case OPT_DEC: - res = exp_check_preinc(op1, p); + res = exp_check_inc(op1, p); break; case KW_SIZEOF: res = exp_check_sizeof(op1, p); -- cgit v1.2.3-70-g09d2