diff options
author | Michael Forney <mforney@mforney.org> | 2019-05-19 14:09:37 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-05-19 15:16:42 -0700 |
commit | 6463066a7858c064626b4260a4ea4b3903e53886 (patch) | |
tree | 2f02e56ce7512efdb2ff4cd67ab9d5037ede609a | |
parent | ed048513e360ba62d5c0520c43b725c69a0ed162 (diff) | |
download | cproc-6463066a7858c064626b4260a4ea4b3903e53886.tar.xz |
eval: Collapse & and * operators in integer constant expressions
They might be used to implement offsetof.
-rw-r--r-- | eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |