mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9068 from ethereum/smt_fix_state_var_init_call
[SMTChecker] Relax assertion about callstack
This commit is contained in:
commit
97cb091ada
@ -104,8 +104,7 @@ void VariableUsage::checkIdentifier(Identifier const& _identifier)
|
||||
solAssert(declaration, "");
|
||||
if (VariableDeclaration const* varDecl = dynamic_cast<VariableDeclaration const*>(declaration))
|
||||
{
|
||||
solAssert(m_lastCall, "");
|
||||
if (!varDecl->isLocalVariable() || varDecl->functionOrModifierDefinition() == m_lastCall)
|
||||
if (!varDecl->isLocalVariable() || (m_lastCall && varDecl->functionOrModifierDefinition() == m_lastCall))
|
||||
m_touchedVariables.insert(varDecl);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract c {
|
||||
uint x;
|
||||
function f() internal returns (uint) {
|
||||
x = x + 1;
|
||||
}
|
||||
bool b = (f() > 0) || (f() > 0);
|
||||
}
|
||||
// ----
|
||||
// Warning: (100-105): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (100-105): Underflow (resulting value less than 0) happens here
|
||||
// Warning: (100-105): Overflow (resulting value larger than 2**256 - 1) happens here
|
Loading…
Reference in New Issue
Block a user