mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
32 lines
483 B
Solidity
32 lines
483 B
Solidity
|
abstract contract D {
|
||
|
function d() external virtual returns (uint);
|
||
|
}
|
||
|
|
||
|
contract C {
|
||
|
|
||
|
D d;
|
||
|
uint v;
|
||
|
bool guard = true;
|
||
|
|
||
|
function inc() public {
|
||
|
++v;
|
||
|
}
|
||
|
|
||
|
function dec() public {
|
||
|
if (guard) return;
|
||
|
--v;
|
||
|
}
|
||
|
|
||
|
function f() public returns (uint) {
|
||
|
guard = false;
|
||
|
uint ret = v > 0 ? d.d() : 0;
|
||
|
guard = true;
|
||
|
return ret;
|
||
|
}
|
||
|
}
|
||
|
// ====
|
||
|
// SMTEngine: chc
|
||
|
// SMTTargets: underflow
|
||
|
// ----
|
||
|
// Warning 3944: (206-209): CHC: Underflow (resulting value less than 0) happens here.
|