solidity/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_2.sol

20 lines
430 B
Solidity
Raw Normal View History

2019-02-21 12:01:58 +00:00
pragma experimental SMTChecker;
2020-02-12 02:21:42 +00:00
pragma experimental ABIEncoderV2;
2019-02-21 12:01:58 +00:00
contract C
{
uint[] array;
2020-02-12 02:21:42 +00:00
function f(uint[] memory a, uint[] memory b) public {
array[0] = 42;
a[0] = 2;
2019-02-21 12:01:58 +00:00
b[0] = 1;
// Erasing knowledge about memory references should not
// erase knowledge about state variables.
assert(array[0] == 42);
assert(a[0] == 2);
assert(b[0] == 1);
}
}
// ----
2020-02-12 02:21:42 +00:00
// Warning: (321-338): Assertion violation happens here