nit: flush gas on error path

This commit is contained in:
Kevaundray Wedderburn 2026-04-03 09:23:21 +01:00
parent 7e3448b177
commit 444dbeb623

View file

@ -406,6 +406,10 @@ func (evm *EVM) runExperimental(contract *Contract, stack *Stack, mem *Memory, c
case PUSH0:
if !evm.chainRules.IsShanghai {
if contract.Gas < gasUsed {
return nil, ErrOutOfGas
}
contract.Gas -= gasUsed
return nil, &ErrInvalidOpCode{opcode: op}
}
gasUsed += GasQuickStep