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:
Leo Alt
2022-11-28 13:07:18 +01:00
parent 40f0329baa
commit 9a8dd4242f
6 changed files with 66 additions and 5 deletions
+3 -4
View File
@@ -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)