Skip to content

Commit

Permalink
Fix bug in invoke - charge gas in CREATE3/4 overload
Browse files Browse the repository at this point in the history
  • Loading branch information
pdobacz committed Oct 26, 2023
1 parent 80b5bdd commit 7341929
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/evmone/baseline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ struct Position
Result (*instr_fn)(StackTop, int64_t, ExecutionState&) noexcept, Position pos, int64_t& gas,
ExecutionState& state) noexcept
{
const auto o = instr_fn(pos.stack_top, gas, state);
gas = o.gas_left;
if (o.status != EVMC_SUCCESS)
const auto result = instr_fn(pos.stack_top, gas, state);
gas = result.gas_left;
if (result.status != EVMC_SUCCESS)
{
state.status = o.status;
state.status = result.status;
return nullptr;
}
return pos.code_it + 1;
Expand Down

0 comments on commit 7341929

Please sign in to comment.