mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
Changed semantics of JUMPDEST so that *the next* instruction is a jump destination
This commit is contained in:
parent
6bf994de4d
commit
25ccd49acb
1 changed files with 7 additions and 5 deletions
|
|
@ -91,9 +91,12 @@ void Compiler::createBasicBlocks(bytesConstRef bytecode)
|
||||||
|
|
||||||
case Instruction::JUMPDEST:
|
case Instruction::JUMPDEST:
|
||||||
{
|
{
|
||||||
// A basic block starts here.
|
// A basic block starts at the next instruction.
|
||||||
splitPoints.insert(currentPC);
|
if (currentPC + 1 < bytecode.size())
|
||||||
indirectJumpTargets.push_back(currentPC);
|
{
|
||||||
|
splitPoints.insert(currentPC + 1);
|
||||||
|
indirectJumpTargets.push_back(currentPC + 1);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -653,8 +656,7 @@ void Compiler::compileBasicBlock(BasicBlock& basicBlock, bytesConstRef bytecode,
|
||||||
|
|
||||||
case Instruction::JUMPDEST:
|
case Instruction::JUMPDEST:
|
||||||
{
|
{
|
||||||
// Extra asserts just in case.
|
// Nothing to do
|
||||||
assert(currentPC == basicBlock.begin());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue