From b4b1ff01d41b3401ebf6c938b142bdc9efbf27dd Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Tue, 15 Oct 2024 16:00:42 -0300 Subject: [PATCH] fix Signed-off-by: Ignacio Hagopian --- core/vm/instructions.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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