diff options
| author | 2026-03-22 17:22:15 +0100 | |
|---|---|---|
| committer | 2026-03-22 17:22:15 +0100 | |
| commit | 2d0b096a8c2f45370ef2535e1c500a008b949611 (patch) | |
| tree | 287d4646b6a0236224a29381860106dbdaf8473f | |
| parent | adf244459ef6946c2050764906357a4ec4010b3f (diff) | |
eval: fix errata in EGETF addr case
The symref given by staticaddrof is in ex2, not sub. This worked by
chance (with sub->ssym.off happening to be zero) on linux, but on
OpenBSD it would give garbage. Which would result in messed up relocations
later leading to miscompilations.
| -rw-r--r-- | src/c_eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/c_eval.c b/src/c_eval.c index 927ea05..e2033a3 100644 --- a/src/c_eval.c +++ b/src/c_eval.c @@ -201,7 +201,7 @@ unop(Expr *ex, enum evalmode mode) } else { assert(ex2.t == ESSYMREF); ex->t = ESSYMREF; - vlong off = (vlong) sub->ssym.off + ex->fld.off; + vlong off = (vlong) ex2.ssym.off + ex->fld.off; if ((int) off != off) return 0; ex->ssym = ex2.ssym; ex->ssym.off = off; |