Improved branch handling in data flow analyzer.

This commit is contained in:
chriseth
2022-03-17 12:24:25 +01:00
parent 430ecb6e16
commit fdf1ea9038
16 changed files with 173 additions and 103 deletions
@@ -0,0 +1,21 @@
{
let x := 0
switch calldataload(0)
case 0 {
x := calldataload(99)
}
case 1 {
if 0 { revert(0, 0) }
}
sstore(0, x)
}
// ----
// step: fullSuite
//
// {
// {
// let x := 0
// if iszero(calldataload(x)) { x := calldataload(99) }
// sstore(0, x)
// }
// }
@@ -0,0 +1,29 @@
{
let b := mload(2)
mstore(0, b)
if calldataload(1) {
mstore(2, 7)
mstore(0, 7)
return(0, 0)
}
sstore(0, mload(0))
}
// ----
// step: loadResolver
//
// {
// {
// let _1 := 2
// let b := mload(_1)
// let _2 := 0
// mstore(_2, b)
// if calldataload(1)
// {
// let _5 := 7
// mstore(_1, _5)
// mstore(_2, _5)
// return(_2, _2)
// }
// sstore(_2, b)
// }
// }
@@ -16,7 +16,7 @@
// case 1 { b := 1 }
// default {
// let x := 1
// let y := b
// let y := 2
// b := 1
// }
// pop(add(1, b))