mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
nit: flush gas on error path
This commit is contained in:
parent
7e3448b177
commit
444dbeb623
1 changed files with 4 additions and 0 deletions
|
|
@ -406,6 +406,10 @@ func (evm *EVM) runExperimental(contract *Contract, stack *Stack, mem *Memory, c
|
||||||
|
|
||||||
case PUSH0:
|
case PUSH0:
|
||||||
if !evm.chainRules.IsShanghai {
|
if !evm.chainRules.IsShanghai {
|
||||||
|
if contract.Gas < gasUsed {
|
||||||
|
return nil, ErrOutOfGas
|
||||||
|
}
|
||||||
|
contract.Gas -= gasUsed
|
||||||
return nil, &ErrInvalidOpCode{opcode: op}
|
return nil, &ErrInvalidOpCode{opcode: op}
|
||||||
}
|
}
|
||||||
gasUsed += GasQuickStep
|
gasUsed += GasQuickStep
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue