solidity/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_need_both_fail.sol

20 lines
404 B
Solidity
Raw Normal View History

2019-03-26 11:03:16 +00:00
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 == 2);
assert(!b);
return b;
}
}
// ----
// Warning: (101-106): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning: (225-235): Assertion violation happens here