mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
fix code
This commit is contained in:
parent
cda882d130
commit
f605fc4eb6
@ -89,13 +89,9 @@ void DataFlowAnalyzer::operator()(ExpressionStatement& _statement)
|
|||||||
|
|
||||||
void DataFlowAnalyzer::operator()(Assignment& _assignment)
|
void DataFlowAnalyzer::operator()(Assignment& _assignment)
|
||||||
{
|
{
|
||||||
m_assignmentCounter++;
|
|
||||||
set<YulString> names;
|
set<YulString> names;
|
||||||
for (auto const& var: _assignment.variableNames)
|
for (auto const& var: _assignment.variableNames)
|
||||||
{
|
|
||||||
m_state.latestAssignment[var.name] = m_assignmentCounter;
|
|
||||||
names.emplace(var.name);
|
names.emplace(var.name);
|
||||||
}
|
|
||||||
assertThrow(_assignment.value, OptimizerException, "");
|
assertThrow(_assignment.value, OptimizerException, "");
|
||||||
clearKnowledgeIfInvalidated(*_assignment.value);
|
clearKnowledgeIfInvalidated(*_assignment.value);
|
||||||
visit(*_assignment.value);
|
visit(*_assignment.value);
|
||||||
@ -171,6 +167,7 @@ void DataFlowAnalyzer::operator()(FunctionDefinition& _fun)
|
|||||||
ScopedSaveAndRestore loopDepthResetter(m_loopDepth, 0u);
|
ScopedSaveAndRestore loopDepthResetter(m_loopDepth, 0u);
|
||||||
pushScope(true);
|
pushScope(true);
|
||||||
|
|
||||||
|
// TODO The params also need their assignment counters set.
|
||||||
for (auto const& parameter: _fun.parameters)
|
for (auto const& parameter: _fun.parameters)
|
||||||
m_variableScopes.back().variables.emplace(parameter.name);
|
m_variableScopes.back().variables.emplace(parameter.name);
|
||||||
for (auto const& var: _fun.returnVariables)
|
for (auto const& var: _fun.returnVariables)
|
||||||
@ -301,9 +298,11 @@ void DataFlowAnalyzer::handleAssignment(set<YulString> const& _variables, Expres
|
|||||||
assignValue(name, _value);
|
assignValue(name, _value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_assignmentCounter++;
|
||||||
auto const& referencedVariables = movableChecker.referencedVariables();
|
auto const& referencedVariables = movableChecker.referencedVariables();
|
||||||
for (auto const& name: _variables)
|
for (auto const& name: _variables)
|
||||||
{
|
{
|
||||||
|
m_state.latestAssignment[name] = m_assignmentCounter;
|
||||||
m_state.references[name] = referencedVariables;
|
m_state.references[name] = referencedVariables;
|
||||||
if (!_isDeclaration)
|
if (!_isDeclaration)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user