From 6463066a7858c064626b4260a4ea4b3903e53886 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 19 May 2019 14:09:37 -0700 Subject: eval: Collapse & and * operators in integer constant expressions They might be used to implement offsetof. --- eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eval.c b/eval.c index 63047d8..c4974b8 100644 --- a/eval.c +++ b/eval.c @@ -109,8 +109,6 @@ eval(struct expr *expr, enum evalkind kind) expr->ident.decl = d; break; case EXPRUNARY: - if (kind != EVALINIT) - break; l = eval(expr->base, kind); if (expr->op != TBAND) break; @@ -120,6 +118,8 @@ eval(struct expr *expr, enum evalkind kind) expr = eval(l->base, kind); break; case EXPRSTRING: + if (kind != EVALINIT) + break; l->ident.decl = stringdecl(l); l->kind = EXPRIDENT; expr->base = l; -- cgit v1.2.3