diff options
| author | 2025-12-08 19:33:08 +0100 | |
|---|---|---|
| committer | 2025-12-08 19:33:08 +0100 | |
| commit | 7cdf81705a1f21bd628a3ab28ca3584d2dc081fa (patch) | |
| tree | 09141cb00bc0dbb146928da420ee236b3e85d6aa /c | |
| parent | 6fa509e2e4b8708289aa9d182d10c6a3ffe1c08a (diff) | |
c: fix some static initialziers
Diffstat (limited to 'c')
| -rw-r--r-- | c/c.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1261,6 +1261,8 @@ expr2reloc(union ref *psym, vlong *paddend, const struct expr *ex) { if (ex->t == EADDROF && globsym(psym, ex->sub)) { *paddend = 0; + } else if (isptrcvt(ex->ty) && globsym(psym, ex)) { + *paddend = 0; } else if (ex->t == EADDROF && ex->sub->t == EGETF && globsym(psym, ex->sub->sub)) { *paddend = ex->sub->fld.off; } else if (ex->t == EGETF && ex->ty.t == TYARRAY && globsym(psym, ex->sub)) { @@ -1278,7 +1280,7 @@ expr2reloc(union ref *psym, vlong *paddend, const struct expr *ex) } } goto Fail; - } else Fail: assert(0 && "non static reloc"); + } else Fail: fatal(&ex->span, "internal bug: non static reloc?"); } static bool |