mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Removing scope rules for pre block in 'For Loops'
This commit is contained in:
@@ -112,10 +112,9 @@ void DataFlowAnalyzer::operator()(FunctionDefinition& _fun)
|
||||
|
||||
void DataFlowAnalyzer::operator()(ForLoop& _for)
|
||||
{
|
||||
// Special scope handling of the pre block.
|
||||
pushScope(false);
|
||||
for (auto& statement: _for.pre.statements)
|
||||
visit(statement);
|
||||
// If the pre block was not empty,
|
||||
// we would have to deal with more complicated scoping rules.
|
||||
assertThrow(_for.pre.statements.empty(), OptimizerException, "");
|
||||
|
||||
AssignmentsSinceContinue assignmentsSinceCont;
|
||||
assignmentsSinceCont(_for.body);
|
||||
@@ -130,8 +129,6 @@ void DataFlowAnalyzer::operator()(ForLoop& _for)
|
||||
clearValues(assignmentsSinceCont.names());
|
||||
(*this)(_for.post);
|
||||
clearValues(assignments.names());
|
||||
|
||||
popScope();
|
||||
}
|
||||
|
||||
void DataFlowAnalyzer::operator()(Block& _block)
|
||||
|
||||
Reference in New Issue
Block a user