mirror of
https://github.com/paradigmxyz/solidity-lean.git
synced 2026-11-15 19:56:39 +00:00
The internal-function-pointer static alias-inlining pre-pass established
`f -> a` at `function(...) internal f = a;` and elided the declaration, then
processed nested control-flow with the alias env's post-state discarded. A
conditional `if (c) { delete f; }` (or reassignment) therefore never
invalidated the alias, so a trailing `f(x)` was statically resolved to a
direct `a(x)` call (success) instead of dispatching on the real, possibly
zeroed, pointer. solc lowers the delete-then-call to Panic(0x51).
Fix: decline the static alias whenever the alias name is reassigned or
deleted anywhere inside a nested block/if/loop/try later in the scope, keeping
`f` a genuine runtime pointer local so the call lowers to Stmt.internalCallPtr.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
121 lines
4.6 KiB
121 lines
4.6 KiB