Fix infinite recursion in function call graph generator due to recursive constant references.

This commit is contained in:
chriseth
2021-06-08 16:39:30 +02:00
parent 7d8a4e63d8
commit 3eaa37030a
3 changed files with 16 additions and 7 deletions
+7 -7
View File
@@ -480,13 +480,6 @@ bool CompilerStack::analyze()
if (source->ast && !typeChecker.checkTypeRequirements(*source->ast))
noErrors = false;
// Create & assign callgraphs and check for contract dependency cycles
if (noErrors)
{
createAndAssignCallGraphs();
findAndReportCyclicContractDependencies();
}
if (noErrors)
{
// Checks that can only be done when all types of all AST nodes are known.
@@ -498,6 +491,13 @@ bool CompilerStack::analyze()
noErrors = false;
}
// Create & assign callgraphs and check for contract dependency cycles
if (noErrors)
{
createAndAssignCallGraphs();
findAndReportCyclicContractDependencies();
}
if (noErrors)
for (Source const* source: m_sourceOrder)
if (source->ast && !PostTypeContractLevelChecker{m_errorReporter}.check(*source->ast))