mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
30 lines
643 B
Plaintext
30 lines
643 B
Plaintext
{
|
|
let x
|
|
// Can be removed, because x is reassigned after the loop
|
|
x := 1
|
|
for { } calldataload(0) { }
|
|
{
|
|
x := 2 // Will not be removed as if-condition can be false.
|
|
if callvalue() {
|
|
// This can be removed because x is overwritten both after the
|
|
// loop at at the start of the next iteration.
|
|
x := 3
|
|
continue
|
|
}
|
|
mstore(x, 2)
|
|
}
|
|
x := 3
|
|
}
|
|
// ----
|
|
// step: redundantAssignEliminator
|
|
//
|
|
// {
|
|
// let x
|
|
// for { } calldataload(0) { }
|
|
// {
|
|
// x := 2
|
|
// if callvalue() { continue }
|
|
// mstore(x, 2)
|
|
// }
|
|
// }
|