From 91016a7f6aa4e18082b574c98e7af6cd40c71981 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet Date: Thu, 28 Jun 2018 14:21:57 +0200 Subject: [PATCH] core/vm: fix rebase issue --- core/vm/interpreter.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 41735269f4..40fb8a2563 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -103,14 +103,6 @@ func (in *Interpreter) enforceRestrictions(op OpCode, operation operation, stack // considered a revert-and-consume-all-gas operation except for // errExecutionReverted which means revert-and-keep-gas-left. func (in *Interpreter) Run(contract *Contract, input []byte) (ret []byte, err error) { - // Increment the call depth which is restricted to 1024 - in.evm.depth++ - defer func() { in.evm.depth-- }() - - // Reset the previous call's return data. It's unimportant to preserve the old buffer - // as every returning call will return new data anyway. - in.returnData = nil - if in.intPool == nil { in.intPool = poolOfIntPools.get() defer func() { @@ -119,6 +111,14 @@ func (in *Interpreter) Run(contract *Contract, input []byte) (ret []byte, err er }() } + // Increment the call depth which is restricted to 1024 + in.evm.depth++ + defer func() { in.evm.depth-- }() + + // Reset the previous call's return data. It's unimportant to preserve the old buffer + // as every returning call will return new data anyway. + in.returnData = nil + // Don't bother with the execution if there's no code. if len(contract.Code) == 0 { return nil, nil