From b66e58d6c9cb1684bac548406f6a950bf0eb65e3 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 6 Nov 2014 16:43:20 +0100 Subject: [PATCH] Prevent optimizer from changing certain parts of the code. --- Compiler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Compiler.cpp b/Compiler.cpp index 571a62d72..93cb172d8 100644 --- a/Compiler.cpp +++ b/Compiler.cpp @@ -89,10 +89,11 @@ void Compiler::appendFunctionSelector(vector> con eth::AssemblyItem jumpTableStart = m_context.pushNewTag(); m_context << eth::Instruction::ADD << eth::Instruction::JUMP; - // jump table @todo it could be that the optimizer destroys this - m_context << jumpTableStart; + // jump table, tell the optimizer not to remove the JUMPDESTs + m_context << eth::AssemblyItem(eth::NoOptimizeBegin) << jumpTableStart; for (pair> const& f: publicFunctions) m_context.appendJumpTo(f.second.second) << eth::Instruction::JUMPDEST; + m_context << eth::AssemblyItem(eth::NoOptimizeEnd); m_context << returnTag << eth::Instruction::STOP;