2021-01-18 10:24:39 +00:00
|
|
|
contract C {
|
|
|
|
int public x;
|
|
|
|
|
|
|
|
function f() public view {
|
|
|
|
int y = 42;
|
|
|
|
bool success = false;
|
|
|
|
try this.x() returns (int v) {
|
|
|
|
y = v;
|
|
|
|
try this.x() returns (int w) {
|
|
|
|
success = true;
|
|
|
|
y = w;
|
|
|
|
}
|
|
|
|
catch {}
|
|
|
|
} catch {}
|
|
|
|
assert(!success || y == x); // should hold
|
|
|
|
assert(y == 42); // should fail
|
|
|
|
}
|
|
|
|
}
|
2021-01-21 18:04:34 +00:00
|
|
|
// ====
|
2021-03-31 15:11:54 +00:00
|
|
|
// SMTEngine: all
|
2021-01-21 18:04:34 +00:00
|
|
|
// SMTIgnoreCex: yes
|
2021-01-18 10:24:39 +00:00
|
|
|
// ----
|
2021-03-31 15:11:54 +00:00
|
|
|
// Warning 6328: (280-295): CHC: Assertion violation happens here.
|
2023-02-09 16:07:13 +00:00
|
|
|
// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
|