From ccb8e79a45d8e06c127e59fb1404a726691c5f26 Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 26 Nov 2025 11:14:55 +0100 Subject: c: more static initializer fixes --- c/eval.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'c/eval.c') diff --git a/c/eval.c b/c/eval.c index 000a627..0dd8140 100644 --- a/c/eval.c +++ b/c/eval.c @@ -167,6 +167,8 @@ isaddrconst(struct expr *ex) return isaddrconst(ex->sub) || (eval(ex->sub, EVSTATICINI) && ex->sub->t == ENUMLIT); if (ex->t == EADDROF && (isglobsym(ex->sub) || (ex->sub->t == EGETF && isglobsym(ex->sub->sub)))) return 1; + if (ex->t == EADDROF && ex->sub->t == EINIT) + return eval(ex->sub, EVSTATICINI); if (ex->t == EGETF && ex->ty.t == TYARRAY && isglobsym(ex->sub)) return 1; if (isglobsym(ex) && in_range(ex->ty.t, TYARRAY, TYFUNC)) -- cgit v1.2.3