diff --git a/core/vm/instructions.go b/core/vm/instructions.go index fa960fc044a9..e7d41cc52717 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -829,14 +829,15 @@ func opCall(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byt if memSize > 0 { scope.Memory.Resize(memSize) } + } - interpreter.evm.callGasTemp, err = callGas(interpreter.evm.chainRules.IsEIP150, scope.Contract.Gas, 0, scope.Stack.Back(0)) - if err != nil { - return nil, err - } - if !scope.Contract.UseGas(interpreter.evm.callGasTemp) { - return nil, ErrOutOfGas - } + var err error + interpreter.evm.callGasTemp, err = callGas(interpreter.evm.chainRules.IsEIP150, scope.Contract.Gas, 0, scope.Stack.Back(0)) + if err != nil { + return nil, err + } + if !scope.Contract.UseGas(interpreter.evm.callGasTemp) { + return nil, ErrOutOfGas } stack := scope.Stack