mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix SMTChecker bug when a public library function is called internally by an internal library function, which in turn is called internally by a contract.
This commit is contained in:
@@ -1172,7 +1172,14 @@ void CHC::defineInterfacesAndSummaries(SourceUnit const& _source)
|
||||
|
||||
m_summaries[contract].emplace(function, createSummaryBlock(*function, *contract));
|
||||
|
||||
if (!function->isConstructor() && function->isPublic() && resolved.count(function))
|
||||
if (
|
||||
!function->isConstructor() &&
|
||||
function->isPublic() &&
|
||||
// Public library functions should have interfaces only for the libraries
|
||||
// they're declared in.
|
||||
(!function->libraryFunction() || (function->scope() == contract)) &&
|
||||
resolved.count(function)
|
||||
)
|
||||
{
|
||||
m_externalSummaries[contract].emplace(function, createSummaryBlock(*function, *contract));
|
||||
|
||||
|
||||
@@ -3162,11 +3162,10 @@ void SMTEncoder::collectFreeFunctions(set<SourceUnit const*, ASTNode::CompareByI
|
||||
auto contract = dynamic_cast<ContractDefinition const*>(node.get());
|
||||
contract && contract->isLibrary()
|
||||
)
|
||||
{
|
||||
for (auto function: contract->definedFunctions())
|
||||
if (!function->isPublic())
|
||||
m_freeFunctions.insert(function);
|
||||
}
|
||||
// We need to add public library functions too because they can be called
|
||||
// internally by internal library functions that are considered free functions.
|
||||
m_freeFunctions.insert(function);
|
||||
}
|
||||
|
||||
void SMTEncoder::createFreeConstants(set<SourceUnit const*, ASTNode::CompareByID> const& _sources)
|
||||
|
||||
Reference in New Issue
Block a user