aboutsummaryrefslogtreecommitdiffstats
path: root/libjulia/optimiser/FullInliner.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-25 22:29:08 +0800
committerchriseth <chris@ethereum.org>2018-10-01 19:10:10 +0800
commitd5cd02b8edb06699b1cc6c37e69694870a4c21dc (patch)
treee693def989d6762d2eed0cc6c884ff77ea83ccc1 /libjulia/optimiser/FullInliner.cpp
parentba62831143e5d4f8ebef6242f821e7a1b3dfc810 (diff)
downloaddexon-solidity-d5cd02b8edb06699b1cc6c37e69694870a4c21dc.tar.gz
dexon-solidity-d5cd02b8edb06699b1cc6c37e69694870a4c21dc.tar.zst
dexon-solidity-d5cd02b8edb06699b1cc6c37e69694870a4c21dc.zip
Fix for inlining inside conditions.
Diffstat (limited to 'libjulia/optimiser/FullInliner.cpp')
-rw-r--r--libjulia/optimiser/FullInliner.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libjulia/optimiser/FullInliner.cpp b/libjulia/optimiser/FullInliner.cpp
index e8776e23..f41dc198 100644
--- a/libjulia/optimiser/FullInliner.cpp
+++ b/libjulia/optimiser/FullInliner.cpp
@@ -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)