mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[SMTChecker] Fixed internal error when increment/decrement is applied on a result of push().
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user