diff --git a/Changelog.md b/Changelog.md index 22db4f95e..911967e42 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,6 +9,7 @@ Features: * Support shifting constant numbers. Bugfixes: + * Optimizer: fix related to stale knowledge about SHA3 operations * Disallow unknown options in ``solc``. * Proper type checking for bound functions. * Code Generator: expect zero stack increase after `super` as an expression. diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index 450ee6ce3..e881c1e26 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)