mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow Yul function definitions inside for loop init blocks.
This commit is contained in:
@@ -479,6 +479,13 @@ VariableDeclaration Parser::parseVariableDeclaration()
|
||||
FunctionDefinition Parser::parseFunctionDefinition()
|
||||
{
|
||||
RecursionGuard recursionGuard(*this);
|
||||
|
||||
if (m_currentForLoopComponent == ForLoopComponent::ForLoopPre)
|
||||
m_errorReporter.syntaxError(
|
||||
location(),
|
||||
"Functions cannot be defined inside a for-loop init block."
|
||||
);
|
||||
|
||||
ForLoopComponent outerForLoopComponent = m_currentForLoopComponent;
|
||||
m_currentForLoopComponent = ForLoopComponent::None;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user