Skip resolving Keccak if AST contains msize.

Also a refactoring changing `m_optimizeMLoad` to `m_containsMSize`.
This commit is contained in:
hrkrshnn
2021-04-22 18:19:47 +02:00
parent 3d29ae73e7
commit b599235b8d
3 changed files with 26 additions and 6 deletions
@@ -0,0 +1,19 @@
{
sstore(0, msize())
mstore(0, 10)
// Keccak-256 should not be evaluated because of the msize.
// Even though, though the code is likely equivalent,
// we skip steps if `msize` is present
let val := keccak256(0, 32)
sstore(1, val)
}
// ----
// step: loadResolver
//
// {
// let _1 := msize()
// let _2 := 0
// sstore(_2, _1)
// mstore(_2, 10)
// sstore(1, keccak256(_2, 32))
// }