forked from ethereum/solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrevert.sol
37 lines (34 loc) · 956 Bytes
/
revert.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
contract C {
function f() pure public {
revert();
// This is not reachable.
assert(false);
}
function g() pure public {
revert("revert message");
// This is not reachable.
assert(false);
}
function h(bool b) pure public {
if (b)
revert();
assert(!b);
}
// Check that arguments are evaluated.
bool x = false;
function m() view internal returns (string memory) {
assert(x != true);
}
function i() public {
x = true;
revert(m());
}
}
// ====
// SMTEngine: all
// ----
// Warning 5740: (83-96): Unreachable code.
// Warning 5740: (188-201): Unreachable code.
// Warning 6321: (375-388): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6328: (394-411): CHC: Assertion violation happens here.
// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.