mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix infinite recursion in function call graph generator due to recursive constant references.
This commit is contained in:
parent
7d8a4e63d8
commit
3eaa37030a
@ -20,6 +20,7 @@ Bugfixes:
|
|||||||
* Code Generator: Fix internal error when super would have to skip an unimplemented function in the virtual resolution order.
|
* Code Generator: Fix internal error when super would have to skip an unimplemented function in the virtual resolution order.
|
||||||
* Control Flow Graph: Take internal calls to functions that always revert into account for reporting unused or unassigned variables.
|
* Control Flow Graph: Take internal calls to functions that always revert into account for reporting unused or unassigned variables.
|
||||||
* Control Flow Graph: Assume unimplemented modifiers use a placeholder.
|
* Control Flow Graph: Assume unimplemented modifiers use a placeholder.
|
||||||
|
* Function Call Graph: Fix internal error connected with circular constant references.
|
||||||
* Natspec: Allow multiple ``@return`` tags on public state variable documentation.
|
* Natspec: Allow multiple ``@return`` tags on public state variable documentation.
|
||||||
* SMTChecker: Fix internal error on struct constructor with fixed bytes member initialized with string literal.
|
* SMTChecker: Fix internal error on struct constructor with fixed bytes member initialized with string literal.
|
||||||
* SMTChecker: Fix internal error on external calls from the constructor.
|
* SMTChecker: Fix internal error on external calls from the constructor.
|
||||||
|
@ -480,13 +480,6 @@ bool CompilerStack::analyze()
|
|||||||
if (source->ast && !typeChecker.checkTypeRequirements(*source->ast))
|
if (source->ast && !typeChecker.checkTypeRequirements(*source->ast))
|
||||||
noErrors = false;
|
noErrors = false;
|
||||||
|
|
||||||
// Create & assign callgraphs and check for contract dependency cycles
|
|
||||||
if (noErrors)
|
|
||||||
{
|
|
||||||
createAndAssignCallGraphs();
|
|
||||||
findAndReportCyclicContractDependencies();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (noErrors)
|
if (noErrors)
|
||||||
{
|
{
|
||||||
// Checks that can only be done when all types of all AST nodes are known.
|
// Checks that can only be done when all types of all AST nodes are known.
|
||||||
@ -498,6 +491,13 @@ bool CompilerStack::analyze()
|
|||||||
noErrors = false;
|
noErrors = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create & assign callgraphs and check for contract dependency cycles
|
||||||
|
if (noErrors)
|
||||||
|
{
|
||||||
|
createAndAssignCallGraphs();
|
||||||
|
findAndReportCyclicContractDependencies();
|
||||||
|
}
|
||||||
|
|
||||||
if (noErrors)
|
if (noErrors)
|
||||||
for (Source const* source: m_sourceOrder)
|
for (Source const* source: m_sourceOrder)
|
||||||
if (source->ast && !PostTypeContractLevelChecker{m_errorReporter}.check(*source->ast))
|
if (source->ast && !PostTypeContractLevelChecker{m_errorReporter}.check(*source->ast))
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
contract C {
|
||||||
|
uint constant a = uint(keccak256(abi.encode(d)));
|
||||||
|
uint c = uint(keccak256(abi.encode(d)));
|
||||||
|
uint constant d = a;
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError 6161: (15-63): The value of the constant a has a cyclic dependency via d.
|
||||||
|
// TypeError 6161: (110-129): The value of the constant d has a cyclic dependency via a.
|
Loading…
Reference in New Issue
Block a user