mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
Use readPushData() in instruction compilation
This commit is contained in:
parent
1008c70a14
commit
bfb96606a2
1 changed files with 4 additions and 8 deletions
|
|
@ -554,15 +554,11 @@ void Compiler::compileBasicBlock(BasicBlock& basicBlock, bytesConstRef bytecode,
|
|||
|
||||
case Instruction::ANY_PUSH:
|
||||
{
|
||||
const auto numBytes = static_cast<size_t>(inst) - static_cast<size_t>(Instruction::PUSH1) + 1;
|
||||
auto value = llvm::APInt(256, 0);
|
||||
for (auto lastPC = currentPC + numBytes; currentPC < lastPC;)
|
||||
{
|
||||
value <<= 8;
|
||||
value |= bytecode[++currentPC];
|
||||
}
|
||||
auto curr = bytecode.begin() + currentPC; // TODO: replace currentPC with iterator
|
||||
auto value = readPushData(curr, bytecode.end());
|
||||
currentPC = curr - bytecode.begin();
|
||||
|
||||
stack.push(m_builder.getInt(value));
|
||||
stack.push(Constant::get(value));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue