aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/Assembly.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-10-21 23:33:30 +0800
committerchriseth <c@ethdev.com>2016-10-22 00:03:57 +0800
commitba42c6e447549e7313a1df88b6ac5a55a79ef263 (patch)
tree236d197514bcee01a2f072c25910b08b8594c66e /libevmasm/Assembly.cpp
parent3e13e59ff96d92f18b972f10f4ef1da1ef249b32 (diff)
downloaddexon-solidity-ba42c6e447549e7313a1df88b6ac5a55a79ef263.tar.gz
dexon-solidity-ba42c6e447549e7313a1df88b6ac5a55a79ef263.tar.zst
dexon-solidity-ba42c6e447549e7313a1df88b6ac5a55a79ef263.zip
Optimizer: generate code starting with empty state
Diffstat (limited to 'libevmasm/Assembly.cpp')
-rw-r--r--libevmasm/Assembly.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp
index 450ee6ce..e881c1e2 100644
--- a/libevmasm/Assembly.cpp
+++ b/libevmasm/Assembly.cpp
@@ -327,8 +327,10 @@ Assembly& Assembly::optimise(bool _enable, bool _isCreation, size_t _runs)
AssemblyItems optimisedItems;
for (BasicBlock const& block: cfg.optimisedBlocks())
{
- assertThrow(!!block.startState, OptimizerException, "");
- CommonSubexpressionEliminator eliminator(*block.startState);
+ // We used to start with the block's initial state but it caused
+ // too many inconsistencies.
+ KnownState emptyState;
+ CommonSubexpressionEliminator eliminator(emptyState);
auto iter = m_items.begin() + block.begin;
auto const end = m_items.begin() + block.end;
while (iter < end)