Skip to content

Commit

Permalink
Don't make extra copies of stack values in MCOPY
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 authored and chfast committed May 26, 2023
1 parent d5f1f71 commit 68bef8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/evmone/instructions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -905,9 +905,9 @@ inline code_iterator swapn(StackTop stack, ExecutionState& state, code_iterator

inline Result mcopy(StackTop stack, int64_t gas_left, ExecutionState& state) noexcept
{
const auto dst_u256 = stack.pop();
const auto src_u256 = stack.pop();
const auto size_u256 = stack.pop();
const auto& dst_u256 = stack.pop();
const auto& src_u256 = stack.pop();
const auto& size_u256 = stack.pop();

if (!check_memory(gas_left, state.memory, std::max(dst_u256, src_u256), size_u256))
return {EVMC_OUT_OF_GAS, gas_left};
Expand Down

0 comments on commit 68bef8f

Please sign in to comment.