aboutsummaryrefslogtreecommitdiffhomepage
path: root/c/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/eval.c')
-rw-r--r--c/eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/c/eval.c b/c/eval.c
index c004813..2f230c9 100644
--- a/c/eval.c
+++ b/c/eval.c
@@ -316,7 +316,8 @@ eval(struct expr *ex, enum evalmode mode)
return 1;
}
if (ex->t == ESTRLIT && mode > EVINTCONST) return 1;
- if (mode == EVSTATICINI && isptrcvt(ex->ty) && isaddrconst(ex)) {
+ if (mode == EVSTATICINI && (isptrcvt(ex->ty) || (isint(ex->ty) && typesize(ex->ty) == targ_primsizes[TYPTR]))
+ && isaddrconst(ex)) {
struct expr *e = ex;
while (e->t == ECAST) e = e->sub;
if (e != ex) {