mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #6544 from ethereum/smt_warn_external
[SMTChecker] Add note about not inlining external function calls
This commit is contained in:
commit
3ba811f1ad
@ -121,6 +121,7 @@ bool SMTChecker::visit(FunctionDefinition const& _function)
|
||||
initializeLocalVariables(_function);
|
||||
m_loopExecutionHappened = false;
|
||||
m_arrayAssignmentHappened = false;
|
||||
m_externalFunctionCallHappened = false;
|
||||
}
|
||||
_function.parameterList().accept(*this);
|
||||
if (_function.returnParameterList())
|
||||
@ -607,6 +608,7 @@ void SMTChecker::endVisit(FunctionCall const& _funCall)
|
||||
popCallStack();
|
||||
break;
|
||||
case FunctionType::Kind::External:
|
||||
m_externalFunctionCallHappened = true;
|
||||
resetStateVariables();
|
||||
resetStorageReferences();
|
||||
break;
|
||||
@ -1295,6 +1297,12 @@ void SMTChecker::checkCondition(
|
||||
" therefore all mapping information is erased after"
|
||||
" a mapping local variable/parameter is assigned.\n"
|
||||
"You can re-introduce information using require().";
|
||||
if (m_externalFunctionCallHappened)
|
||||
extraComment +=
|
||||
"\nNote that external function calls are not inlined,"
|
||||
" even if the source code of the function is available."
|
||||
" This is due to the possibility that the actual called contract"
|
||||
" has the same ABI but implements the function differently.";
|
||||
|
||||
SecondarySourceLocation secondaryLocation{};
|
||||
secondaryLocation.append(extraComment, SourceLocation{});
|
||||
|
@ -277,6 +277,7 @@ private:
|
||||
VariableUsage m_variableUsage;
|
||||
bool m_loopExecutionHappened = false;
|
||||
bool m_arrayAssignmentHappened = false;
|
||||
bool m_externalFunctionCallHappened = false;
|
||||
// True if the "No SMT solver available" warning was already created.
|
||||
bool m_noSolverWarning = false;
|
||||
/// An Expression may have multiple smt::Expression due to
|
||||
|
Loading…
Reference in New Issue
Block a user