solidity/test/libsolidity/smtCheckerTests/operators/delete_array_push.sol
2023-03-09 14:59:32 +01:00

23 lines
736 B
Solidity

contract C {
int[][] array2d;
function s() public {
delete array2d.push();
assert(array2d[array2d.length - 1].length == 0);
// Fails
assert(array2d[array2d.length - 1].length != 0);
delete array2d.push().push();
uint length = array2d.length;
uint length2 = array2d[length - 1].length;
assert(array2d[length - 1][length2 - 1] == 0);
// Fails
assert(array2d[length - 1][length2 - 1] != 0);
}
}
// ====
// SMTEngine: all
// SMTIgnoreCex: yes
// ----
// Warning 6328: (143-190): CHC: Assertion violation happens here.
// Warning 6328: (363-408): CHC: Assertion violation happens here.
// Info 1391: CHC: 16 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.