solidity/test/libsolidity/smtCheckerTests/array_members/storage_pointer_push_1.sol

19 lines
416 B
Solidity
Raw Normal View History

2020-07-17 08:00:25 +00:00
pragma experimental SMTChecker;
contract C {
int[][] array2d;
function l() public {
s().push();
// False positive.
// Knowledge is erased because `s()` is a storage pointer.
assert(array2d[2].length > 0);
}
function s() internal returns (int[] storage) {
array2d.push();
array2d.push();
array2d.push();
return array2d[2];
}
}
// ----
2020-07-23 10:58:15 +00:00
// Warning 6328: (184-213): Assertion violation happens here