mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix for inlining inside conditions.
This commit is contained in:
@@ -89,6 +89,9 @@ void InlineModifier::operator()(ForLoop& _loop)
|
||||
|
||||
void InlineModifier::operator()(Block& _block)
|
||||
{
|
||||
vector<Statement> saved;
|
||||
saved.swap(m_statementsToPrefix);
|
||||
|
||||
// This is only used if needed to minimize the number of move operations.
|
||||
vector<Statement> modifiedStatements;
|
||||
for (size_t i = 0; i < _block.statements.size(); ++i)
|
||||
@@ -110,6 +113,8 @@ void InlineModifier::operator()(Block& _block)
|
||||
}
|
||||
if (!modifiedStatements.empty())
|
||||
_block.statements = std::move(modifiedStatements);
|
||||
|
||||
saved.swap(m_statementsToPrefix);
|
||||
}
|
||||
|
||||
void InlineModifier::visit(Expression& _expression)
|
||||
|
||||
Reference in New Issue
Block a user