aboutsummaryrefslogtreecommitdiffstats
path: root/Compiler.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-11-06 23:43:20 +0800
committerChristian <c@ethdev.com>2014-11-07 05:55:42 +0800
commitb66e58d6c9cb1684bac548406f6a950bf0eb65e3 (patch)
tree26608ff81576b173f7d6c29c45a11c850fbaf5ff /Compiler.cpp
parent225fc8e1b31860ab002c38fb9ff326f20b76965f (diff)
downloaddexon-solidity-b66e58d6c9cb1684bac548406f6a950bf0eb65e3.tar
dexon-solidity-b66e58d6c9cb1684bac548406f6a950bf0eb65e3.tar.gz
dexon-solidity-b66e58d6c9cb1684bac548406f6a950bf0eb65e3.tar.bz2
dexon-solidity-b66e58d6c9cb1684bac548406f6a950bf0eb65e3.tar.lz
dexon-solidity-b66e58d6c9cb1684bac548406f6a950bf0eb65e3.tar.xz
dexon-solidity-b66e58d6c9cb1684bac548406f6a950bf0eb65e3.tar.zst
dexon-solidity-b66e58d6c9cb1684bac548406f6a950bf0eb65e3.zip
Prevent optimizer from changing certain parts of the code.
Diffstat (limited to 'Compiler.cpp')
-rw-r--r--Compiler.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Compiler.cpp b/Compiler.cpp
index 571a62d7..93cb172d 100644
--- a/Compiler.cpp
+++ b/Compiler.cpp
@@ -89,10 +89,11 @@ void Compiler::appendFunctionSelector(vector<ASTPointer<FunctionDefinition>> 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<string, pair<FunctionDefinition const*, eth::AssemblyItem>> const& f: publicFunctions)
m_context.appendJumpTo(f.second.second) << eth::Instruction::JUMPDEST;
+ m_context << eth::AssemblyItem(eth::NoOptimizeEnd);
m_context << returnTag << eth::Instruction::STOP;