Fix argument stack slot reuse for functions without return variables.

This commit is contained in:
Daniel Kirchner
2021-04-15 15:13:31 +02:00
parent f1a474e599
commit 8a4497a8d3
3 changed files with 37 additions and 2 deletions
@@ -0,0 +1,29 @@
{
function f(x, y) {
mstore(0x80, x)
if calldataload(0) { sstore(y, y) }
}
}
// ====
// stackOptimization: true
// ----
// PUSH1 0x17
// JUMP
// JUMPDEST
// DUP1
// PUSH1 0x80
// MSTORE
// POP
// PUSH1 0x0
// CALLDATALOAD
// ISZERO
// PUSH1 0x13
// JUMPI
// DUP1
// DUP2
// SSTORE
// JUMPDEST
// POP
// JUMPDEST
// JUMP
// JUMPDEST