[SMTChecker] Fixed internal error when increment/decrement is applied on a result of push().

This commit is contained in:
Martin Blicha
2020-12-14 22:52:44 +01:00
parent 2ca70bd71a
commit 71f835b71b
3 changed files with 42 additions and 14 deletions
@@ -0,0 +1,13 @@
pragma experimental SMTChecker;
contract C {
uint[] x;
function f() public {
require(x.length == 0);
++x.push();
assert(x.length == 1);
assert(x[0] == 1); // should hold
assert(x[0] == 42); // should fail
}
}
// ----
// Warning 6328: (182-200): CHC: Assertion violation happens here.\nCounterexample:\nx = [1]\n\n\n\nTransaction trace:\nconstructor()\nState: x = []\nf()
@@ -0,0 +1,11 @@
pragma experimental SMTChecker;
contract C {
struct S {
int[][] d;
}
S[] data;
function f() public {
++data[1].d[3].push();
}
}