solidity/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_fail.sol
2020-07-23 18:49:03 +02:00

20 lines
415 B
Solidity

pragma experimental SMTChecker;
contract c {
uint x;
function f() internal returns (uint) {
x = x + 1;
return x;
}
function g() public returns (bool) {
x = 0;
bool b = (f() == 0) && (f() == 0);
assert(x == 1);
assert(b);
return b;
}
}
// ----
// Warning 6328: (227-236): Assertion violation happens here
// Warning 2661: (101-106): Overflow (resulting value larger than 2**256 - 1) happens here