Browse Source

Do not update the stack after it was freed by RETURN instruction

cl-refactor
Paweł Bylica 10 years ago
parent
commit
1224e20c7f
  1. 4
      libevmjit/BasicBlock.cpp

4
libevmjit/BasicBlock.cpp

@ -137,6 +137,9 @@ void BasicBlock::synchronizeLocalStack(Stack& _evmStack)
{
auto blockTerminator = m_llvmBB->getTerminator();
assert(blockTerminator != nullptr);
if (blockTerminator->getOpcode() != llvm::Instruction::Ret)
{
// Not needed in case of ret instruction. Ret also invalidates the stack.
m_builder.SetInsertPoint(blockTerminator);
auto currIter = m_currentStack.begin();
@ -164,6 +167,7 @@ void BasicBlock::synchronizeLocalStack(Stack& _evmStack)
assert(*currIter != nullptr);
_evmStack.push(*currIter);
}
}
// Emit get() for all (used) values from the initial stack
for (size_t idx = 0; idx < m_initialStack.size(); ++idx)

Loading…
Cancel
Save