Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Commit e89c186

Browse files
committed
Minor fixes in tracing
1 parent 61e7b50 commit e89c186

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

libaleth-interpreter/VM.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void VM::trace() noexcept
116116
auto const& metrics = c_metrics[static_cast<size_t>(m_OP)];
117117
evmc_uint256be topStackItem;
118118
evmc_uint256be const* pushedStackItem = nullptr;
119-
if (metrics.num_stack_returned_items == 1)
119+
if (metrics.num_stack_returned_items >= 1)
120120
{
121121
topStackItem = toEvmC(m_SPP[0]);
122122
pushedStackItem = &topStackItem;
@@ -1244,10 +1244,12 @@ void VM::interpretCases()
12441244
// Construct a number out of PUSH bytes.
12451245
// This requires the code has been copied and extended by 32 zero
12461246
// bytes to handle "out of code" push data here.
1247-
for (++m_PC; numBytes--; ++m_PC)
1248-
m_SPP[0] = (m_SPP[0] << 8) | m_code[m_PC];
1247+
uint64_t codeOffset = m_PC + 1;
1248+
for (; numBytes--; ++codeOffset)
1249+
m_SPP[0] = (m_SPP[0] << 8) | m_code[codeOffset];
12491250

12501251
trace();
1252+
m_PC = codeOffset;
12511253
}
12521254
CONTINUE
12531255

0 commit comments

Comments
 (0)