mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Test case that shows a CSE bug related to scopes.
This commit is contained in:
parent
7609e2871e
commit
c34fa43d5b
@ -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, b)
|
||||
// mstore(0, x)
|
||||
// }
|
Loading…
Reference in New Issue
Block a user