mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Prevent optimizer from changing certain parts of the code.
This commit is contained in:
parent
225fc8e1b3
commit
b66e58d6c9
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user