You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bugc: a moved inlined invoke loses its call site's code range #390
When common subexpression elimination drops the first instruction of an inlined body, #384 moves its invoke onto the next instruction, but the call site's code range that inlining gathered onto that first instruction goes with the CSE merge onto the earlier, equal instruction instead. The entry of the inlined code (its JUMPDEST) then has only the callee body's source range, so the caller's locals are out of scope there and are not listed at all.
At -O 2:
name MovedInvoke;
define {
struct P { a: uint64; b: uint32; };
function f() -> uint256 { return (msg.sender as uint256) % 7; };
}
storage { [0] r: uint256; [1] ps: mapping<address, P>; }
create {}
code {
let p: P = ps[msg.sender];
p.a = p.a + 5;
let h = f();
p.b = p.b + 1;
ps[msg.sender] = p;
r = h;
}
The JUMP into f's code lists p and h. The JUMPDEST after it lists neither, and the op carrying invoke f has no code range for the call f().
Activity