Skip to content

Commit a0fd4b7

Browse files
holimanfjl
authored andcommitted
core/vm: unshadow err to make it visible in tracers(#18504)
1 parent 822dc1b commit a0fd4b7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎core/vm/interpreter.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
182182
pcCopy uint64 // needed for the deferred Tracer
183183
gasCopy uint64 // for Tracer to log gas remaining before execution
184184
logged bool // deferred Tracer should ignore already logged steps
185+
res []byte // result of the opcode execution function
185186
)
186187
contract.Input = input
187188

@@ -216,11 +217,11 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
216217
if !operation.valid {
217218
return nil, fmt.Errorf("invalid opcode 0x%x", int(op))
218219
}
219-
if err := operation.validateStack(stack); err != nil {
220+
if err = operation.validateStack(stack); err != nil {
220221
return nil, err
221222
}
222223
// If the operation is valid, enforce and write restrictions
223-
if err := in.enforceRestrictions(op, operation, stack); err != nil {
224+
if err = in.enforceRestrictions(op, operation, stack); err != nil {
224225
return nil, err
225226
}
226227

@@ -254,7 +255,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
254255
}
255256

256257
// execute the operation
257-
res, err := operation.execute(&pc, in, contract, mem, stack)
258+
res, err = operation.execute(&pc, in, contract, mem, stack)
258259
// verifyPool is a build flag. Pool verification makes sure the integrity
259260
// of the integer pool by comparing values to a default value.
260261
if verifyPool {

0 commit comments

Comments
 (0)