core/vm: unshadow err to make it visible in tracers(#18504)

This commit is contained in:
Martin Holst Swende 2019-02-04 15:26:21 +01:00 committed by Felix Lange
parent 822dc1bfb1
commit a0fd4b7e57

View File

@ -182,6 +182,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
pcCopy uint64 // needed for the deferred Tracer pcCopy uint64 // needed for the deferred Tracer
gasCopy uint64 // for Tracer to log gas remaining before execution gasCopy uint64 // for Tracer to log gas remaining before execution
logged bool // deferred Tracer should ignore already logged steps logged bool // deferred Tracer should ignore already logged steps
res []byte // result of the opcode execution function
) )
contract.Input = input contract.Input = input
@ -216,11 +217,11 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
if !operation.valid { if !operation.valid {
return nil, fmt.Errorf("invalid opcode 0x%x", int(op)) return nil, fmt.Errorf("invalid opcode 0x%x", int(op))
} }
if err := operation.validateStack(stack); err != nil { if err = operation.validateStack(stack); err != nil {
return nil, err return nil, err
} }
// If the operation is valid, enforce and write restrictions // If the operation is valid, enforce and write restrictions
if err := in.enforceRestrictions(op, operation, stack); err != nil { if err = in.enforceRestrictions(op, operation, stack); err != nil {
return nil, err return nil, err
} }
@ -254,7 +255,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
} }
// execute the operation // execute the operation
res, err := operation.execute(&pc, in, contract, mem, stack) res, err = operation.execute(&pc, in, contract, mem, stack)
// verifyPool is a build flag. Pool verification makes sure the integrity // verifyPool is a build flag. Pool verification makes sure the integrity
// of the integer pool by comparing values to a default value. // of the integer pool by comparing values to a default value.
if verifyPool { if verifyPool {