diff options
author | chriseth <chris@ethereum.org> | 2018-10-19 00:58:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-19 00:58:46 +0800 |
commit | 52ffe5262edb3bd1fcb2477d8f3339f135f85563 (patch) | |
tree | 2106f5a23016d73cee12dd81a65ae45fa2400786 /test | |
parent | 7609e2871e77b623d4c6187b7ebed693ce74cd0e (diff) | |
parent | 48749146da6bd335928126855053ea0e3b66aee4 (diff) | |
download | dexon-solidity-52ffe5262edb3bd1fcb2477d8f3339f135f85563.tar dexon-solidity-52ffe5262edb3bd1fcb2477d8f3339f135f85563.tar.gz dexon-solidity-52ffe5262edb3bd1fcb2477d8f3339f135f85563.tar.bz2 dexon-solidity-52ffe5262edb3bd1fcb2477d8f3339f135f85563.tar.lz dexon-solidity-52ffe5262edb3bd1fcb2477d8f3339f135f85563.tar.xz dexon-solidity-52ffe5262edb3bd1fcb2477d8f3339f135f85563.tar.zst dexon-solidity-52ffe5262edb3bd1fcb2477d8f3339f135f85563.zip |
Merge pull request #5269 from ethereum/cseBugfix
Bugfix in common subexpression eliminator related to scopes.
Diffstat (limited to 'test')
-rw-r--r-- | test/libyul/yulOptimizerTests/commonSubexpressionEliminator/scopes.yul | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/scopes.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/scopes.yul new file mode 100644 index 00000000..49b4c916 --- /dev/null +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/scopes.yul @@ -0,0 +1,25 @@ +{ + let a := 10 + let x := 20 + { + let b := calldataload(0) + let d := calldataload(1) + x := d + } + // We had a bug where "calldataload(0)" was incorrectly replaced by "b" + mstore(0, calldataload(0)) + mstore(0, x) +} +// ---- +// commonSubexpressionEliminator +// { +// let a := 10 +// let x := 20 +// { +// let b := calldataload(0) +// let d := calldataload(1) +// x := d +// } +// mstore(0, calldataload(0)) +// mstore(0, x) +// } |