2019-04-02 10:59:19 +00:00
|
|
|
contract C
|
|
|
|
{
|
|
|
|
uint[] array;
|
2021-03-23 18:15:14 +00:00
|
|
|
function p() public { array.push(); }
|
2019-04-02 10:59:19 +00:00
|
|
|
function f(uint x) public {
|
2021-03-23 18:15:14 +00:00
|
|
|
require(x < array.length);
|
2019-04-02 10:59:19 +00:00
|
|
|
array[x] = 5;
|
|
|
|
uint a = --array[x];
|
|
|
|
assert(array[x] == 4);
|
|
|
|
assert(a == 4);
|
|
|
|
uint b = array[x]--;
|
|
|
|
assert(array[x] == 3);
|
|
|
|
// Should fail.
|
|
|
|
assert(b > 4);
|
|
|
|
}
|
|
|
|
}
|
2020-12-29 10:53:35 +00:00
|
|
|
// ====
|
2021-03-31 15:11:54 +00:00
|
|
|
// SMTEngine: all
|
2020-12-29 10:53:35 +00:00
|
|
|
// SMTIgnoreCex: yes
|
2019-04-02 10:59:19 +00:00
|
|
|
// ----
|
2021-03-31 15:11:54 +00:00
|
|
|
// Warning 6328: (275-288): CHC: Assertion violation happens here.
|