2020-10-26 16:16:27 +00:00
|
|
|
contract C {
|
|
|
|
uint[][] c;
|
|
|
|
|
|
|
|
function f() public {
|
|
|
|
require(c.length == 0);
|
|
|
|
c.push().push() = 2;
|
|
|
|
assert(c.length == 1);
|
|
|
|
assert(c[0].length == 1);
|
|
|
|
assert(c[0][0] == 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
function g() public {
|
|
|
|
c.push().push() = 2;
|
|
|
|
assert(c.length > 0);
|
|
|
|
assert(c[c.length - 1].length == 1);
|
|
|
|
assert(c[c.length - 1][c[c.length - 1].length - 1] == 2);
|
|
|
|
// Fails
|
|
|
|
assert(c[c.length - 1][c[c.length - 1].length - 1] == 200);
|
|
|
|
}
|
|
|
|
}
|
2021-03-31 15:11:54 +00:00
|
|
|
// ====
|
|
|
|
// SMTEngine: all
|
2021-10-12 09:12:18 +00:00
|
|
|
// SMTIgnoreCex: yes
|
2020-10-26 16:16:27 +00:00
|
|
|
// ----
|
2021-08-20 16:47:30 +00:00
|
|
|
// Warning 6328: (362-420): CHC: Assertion violation happens here.
|
2023-02-09 16:07:13 +00:00
|
|
|
// Info 1391: CHC: 23 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
|