aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeddy <[email protected]>2014-04-05 08:32:17 +0800
committerTeddy <[email protected]>2014-04-05 08:32:17 +0800
commit3e27b6426011dfda8cc79672f2c821ae2ac12726 (patch)
tree29d2fca5283aa4e390fa35df566dab873350ee7f
parentdae43d5db4161609a0056a3c107670a7ab051531 (diff)
...
-rw-r--r--semantics.c7
1 files 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);