Skip to content

Commit 8aaf5a1

Browse files
committed
Fix infinite recursion in function call graph generator due to recursive constant references.
1 parent 4047f80 commit 8aaf5a1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Bugfixes:
2020
* Code Generator: Fix internal error when super would have to skip an unimplemented function in the virtual resolution order.
2121
* Control Flow Graph: Take internal calls to functions that always revert into account for reporting unused or unassigned variables.
2222
* Control Flow Graph: Assume unimplemented modifiers use a placeholder.
23+
* Function Call Graph: Fix internal error connected with circular constant references.
2324
* SMTChecker: Fix internal error on struct constructor with fixed bytes member initialized with string literal.
2425
* SMTChecker: Fix internal error on external calls from the constructor.
2526
* SMTChecker: Fix internal error on conversion from ``bytes`` to ``fixed bytes``.

libsolidity/interface/CompilerStack.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -474,13 +474,6 @@ bool CompilerStack::analyze()
474474
if (source->ast && !typeChecker.checkTypeRequirements(*source->ast))
475475
noErrors = false;
476476

477-
// Create & assign callgraphs and check for contract dependency cycles
478-
if (noErrors)
479-
{
480-
createAndAssignCallGraphs();
481-
findAndReportCyclicContractDependencies();
482-
}
483-
484477
if (noErrors)
485478
{
486479
// Checks that can only be done when all types of all AST nodes are known.
@@ -492,6 +485,13 @@ bool CompilerStack::analyze()
492485
noErrors = false;
493486
}
494487

488+
// Create & assign callgraphs and check for contract dependency cycles
489+
if (noErrors)
490+
{
491+
createAndAssignCallGraphs();
492+
findAndReportCyclicContractDependencies();
493+
}
494+
495495
if (noErrors)
496496
for (Source const* source: m_sourceOrder)
497497
if (source->ast && !PostTypeContractLevelChecker{m_errorReporter}.check(*source->ast))

0 commit comments

Comments
 (0)