solidity/test/libsolidity/smtCheckerTests/operators/delete_array_index_2d.sol

42 lines
1.1 KiB
Solidity
Raw Normal View History

2019-05-06 16:24:15 +00:00
pragma experimental SMTChecker;
contract C
{
uint[][] a;
2021-03-23 18:15:14 +00:00
constructor() {
init();
}
function init() internal {
a.push();
a.push();
a.push();
a[1].push();
a[1].push();
a[2].push();
a[2].push();
}
2019-05-06 16:24:15 +00:00
function f(bool b) public {
2020-04-14 09:09:38 +00:00
a[1][1] = 512;
2019-05-06 16:24:15 +00:00
if (b)
delete a;
else
delete a[2];
2021-03-23 18:15:14 +00:00
init();
2019-05-06 16:24:15 +00:00
assert(a[2][3] == 0);
2019-08-22 13:44:30 +00:00
assert(a[1][1] == 0);
2019-05-06 16:24:15 +00:00
}
}
2020-02-12 02:21:42 +00:00
// ====
// SMTSolvers: z3
// ----
2021-03-23 18:15:14 +00:00
// Warning 6368: (247-251): CHC: Out of bounds access might happen here.
// Warning 6368: (247-254): CHC: Out of bounds access might happen here.
2021-01-21 18:04:34 +00:00
// Warning 6368: (301-305): CHC: Out of bounds access might happen here.
// Warning 6368: (326-330): CHC: Out of bounds access might happen here.
// Warning 6368: (326-333): CHC: Out of bounds access might happen here.
// Warning 6328: (319-339): CHC: Assertion violation might happen here.
// Warning 6368: (350-354): CHC: Out of bounds access might happen here.
// Warning 6368: (350-357): CHC: Out of bounds access might happen here.
// Warning 6328: (343-363): CHC: Assertion violation might happen here.
// Warning 4661: (343-363): BMC: Assertion violation happens here.