File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed
test/libsolidity/syntaxTests/constants Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff 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 * Natspec: Allow multiple `` @return `` tags on public state variable documentation.
2425 * SMTChecker: Fix internal error on struct constructor with fixed bytes member initialized with string literal.
2526 * SMTChecker: Fix internal error on external calls from the constructor.
Original file line number Diff line number Diff line change @@ -480,13 +480,6 @@ bool CompilerStack::analyze()
480480 if (source->ast && !typeChecker.checkTypeRequirements (*source->ast ))
481481 noErrors = false ;
482482
483- // Create & assign callgraphs and check for contract dependency cycles
484- if (noErrors)
485- {
486- createAndAssignCallGraphs ();
487- findAndReportCyclicContractDependencies ();
488- }
489-
490483 if (noErrors)
491484 {
492485 // Checks that can only be done when all types of all AST nodes are known.
@@ -498,6 +491,13 @@ bool CompilerStack::analyze()
498491 noErrors = false ;
499492 }
500493
494+ // Create & assign callgraphs and check for contract dependency cycles
495+ if (noErrors)
496+ {
497+ createAndAssignCallGraphs ();
498+ findAndReportCyclicContractDependencies ();
499+ }
500+
501501 if (noErrors)
502502 for (Source const * source: m_sourceOrder)
503503 if (source->ast && !PostTypeContractLevelChecker{m_errorReporter}.check (*source->ast ))
Original file line number Diff line number Diff line change 1+ contract C {
2+ uint constant a = uint (keccak256 (abi.encode (d)));
3+ uint c = uint (keccak256 (abi.encode (d)));
4+ uint constant d = a;
5+ }
6+ // ----
7+ // TypeError 6161: (15-63): The value of the constant a has a cyclic dependency via d.
8+ // TypeError 6161: (110-129): The value of the constant d has a cyclic dependency via a.
You can’t perform that action at this time.
0 commit comments