solidity/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var.sol

20 lines
299 B
Solidity
Raw Normal View History

pragma experimental SMTChecker;
contract C
{
uint x;
function f() internal {
require(x < 10000);
x = x + 1;
}
function g(bool b) public {
x = 0;
if (b)
f();
// Should fail for `b == true`.
assert(x == 0);
}
}
// ----
2020-07-13 18:48:00 +00:00
// Warning 6328: (209-223): Assertion violation happens here