Message ID | 20201118224620.11674-1-luc.vanoostenryck@gmail.com (mailing list archive) |
---|---|
State | Mainlined, archived |
Headers | show |
Series | simplify unrestricted postop | expand |
diff --git a/evaluate.c b/evaluate.c index c39f9ec73da9..3567f702b8ac 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;
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 bes tested in unrestrict(). So, simply call unrestrict() unconditionally. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- evaluate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)