solidity/test/libsolidity/smtCheckerTests/operators/conditional_assignment_statevar_1.sol

21 lines
619 B
Solidity
Raw Normal View History

pragma experimental SMTChecker;
contract C {
uint a;
bool b;
2020-12-16 17:32:34 +00:00
constructor(bool _b) {
b = _b;
}
function f() public returns(uint c) {
2020-12-16 17:32:34 +00:00
c = b ? a + 10 : ++a;
assert(c >= a);
}
}
// ----
2020-12-16 17:32:34 +00:00
// Warning 4984: (167-173): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 4984: (176-179): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 2661: (167-173): BMC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 2661: (176-179): BMC: Overflow (resulting value larger than 2**256 - 1) happens here.