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

31 lines
536 B
Solidity
Raw Normal View History

2019-05-06 16:24:15 +00:00
contract C
{
uint[][] a;
2021-03-23 18:15:14 +00:00
constructor() {
init();
}
function init() internal {
a.push();
a.push();
2021-03-31 15:11:54 +00:00
a[0].push();
2021-03-23 18:15:14 +00:00
a[1].push();
}
2019-05-06 16:24:15 +00:00
function f(bool b) public {
2021-03-31 15:11:54 +00:00
// Removed due to Spacer's nondeterminism.
//a[1][1] = 512;
2019-05-06 16:24:15 +00:00
if (b)
delete a;
else
2021-03-31 15:11:54 +00:00
delete a[1];
2021-03-23 18:15:14 +00:00
init();
2021-03-31 15:11:54 +00:00
assert(a[1][0] == 0);
assert(a[0][0] == 0);
2019-05-06 16:24:15 +00:00
}
}
2020-02-12 02:21:42 +00:00
// ====
2021-03-31 15:11:54 +00:00
// SMTEngine: all
// SMTIgnoreCex: yes
// ----
2021-03-31 15:11:54 +00:00
// Warning 6328: (315-335): CHC: Assertion violation might happen here.
// Warning 4661: (315-335): BMC: Assertion violation happens here.