mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 04:06:44 +00:00
Cleanup block terminator generation
This commit is contained in:
parent
1463897efb
commit
bb51b3476c
1 changed files with 4 additions and 11 deletions
|
|
@ -862,19 +862,12 @@ void Compiler::compileBasicBlock(BasicBlock& basicBlock, const bytes& bytecode,
|
||||||
|
|
||||||
gasMeter.commitCostBlock();
|
gasMeter.commitCostBlock();
|
||||||
|
|
||||||
if (!m_builder.GetInsertBlock()->getTerminator()) // If block not terminated
|
if (!basicBlock.llvm()->getTerminator()) // If block not terminated
|
||||||
{
|
{
|
||||||
if (basicBlock.end() == bytecode.size())
|
if (nextBasicBlock)
|
||||||
{
|
m_builder.CreateBr(nextBasicBlock); // Branch to the next block
|
||||||
// Return STOP code
|
|
||||||
m_builder.CreateRet(Constant::get(ReturnCode::Stop));
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
m_builder.CreateRet(Constant::get(ReturnCode::Stop)); // Return STOP code
|
||||||
// Branch to the next block.
|
|
||||||
assert(nextBasicBlock);
|
|
||||||
m_builder.CreateBr(nextBasicBlock);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue