From ba42c6e447549e7313a1df88b6ac5a55a79ef263 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 21 Oct 2016 17:33:30 +0200 Subject: Optimizer: generate code starting with empty state --- libevmasm/Assembly.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libevmasm') 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) -- cgit v1.2.3