[SMTChecker] Fix compound assignment to push

This commit is contained in:
Martin Blicha
2021-03-24 14:54:13 +01:00
parent 13d3b35141
commit 98446782e2
3 changed files with 22 additions and 29 deletions
@@ -0,0 +1,15 @@
pragma experimental SMTChecker;
contract C {
int[] u;
function t() public {
require(u.length == 0);
u.push() -= 1;
assert(u[0] < 0); // should hold
assert(u[0] >= 0); // should fail
}
}
// ----
// Warning 6328: (161-178): CHC: Assertion violation happens here.\nCounterexample:\nu = [(- 1)]\n\nTransaction trace:\nC.constructor()\nState: u = []\nC.t()