2019-03-18 16:43:28 +00:00
|
|
|
{
|
2019-03-26 16:35:26 +00:00
|
|
|
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
|
2019-03-18 16:43:28 +00:00
|
|
|
}
|
|
|
|
// ----
|
2020-03-17 22:31:56 +00:00
|
|
|
// step: redundantAssignEliminator
|
|
|
|
//
|
2019-03-18 16:43:28 +00:00
|
|
|
// {
|
2019-03-26 16:35:26 +00:00
|
|
|
// let x
|
2019-05-08 10:41:19 +00:00
|
|
|
// for { } calldataload(0) { }
|
2019-03-18 16:43:28 +00:00
|
|
|
// {
|
|
|
|
// x := 2
|
2019-05-08 10:41:19 +00:00
|
|
|
// if callvalue() { continue }
|
2019-03-18 16:43:28 +00:00
|
|
|
// mstore(x, 2)
|
|
|
|
// }
|
|
|
|
// }
|