aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-18 18:23:57 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-19 18:08:05 +0100
commit0dbc3bb8bfe0903d6b536e83a9643d403ff0ad3f (patch)
tree0a1d3d4e1ce144f8219f4c158152a3843a98ddd6
parent626c474204e8262467a316099b6074cab964237c (diff)
downloadsparse-0dbc3bb8bfe0903d6b536e83a9643d403ff0ad3f.tar.gz
simplify unrestricted postop
The '++' and '--' operator used in evaluate_postop() are 'restricted' operators. It's thus unneeded to call restricted_unop() on them as it will always return '1'. It's also unneeded to test for TYPE_RESTRICT since it will also be tested in unrestrict(). So, simply call unrestrict() unconditionally. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--evaluate.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/evaluate.c b/evaluate.c
index c39f9ec7..3567f702 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -1919,8 +1919,7 @@ static struct symbol *evaluate_postop(struct expression *expr)
return NULL;
}
- if ((class & TYPE_RESTRICT) && restricted_unop(expr->op, &ctype))
- unrestrict(expr, class, &ctype);
+ unrestrict(expr, class, &ctype);
if (class & TYPE_NUM) {
multiply = 1;