Skip to content

Commit c78b9e6

Browse files
committed
core/vm: for tracing, do not report post-op memory (ethereum#24867)
1 parent 45c644c commit c78b9e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/vm/interpreter.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,15 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
255255
if err != nil || !contract.UseGas(dynamicCost) {
256256
return nil, ErrOutOfGas
257257
}
258+
// Do tracing before memory expansion
259+
if in.cfg.Debug {
260+
in.cfg.Tracer.CaptureState(in.evm, pc, op, gasCopy, cost, callContext, in.returnData, in.evm.depth, err)
261+
logged = true
262+
}
258263
if memorySize > 0 {
259264
mem.Resize(memorySize)
260265
}
261-
}
262-
if in.cfg.Debug {
266+
} else if in.cfg.Debug {
263267
in.cfg.Tracer.CaptureState(in.evm, pc, op, gasCopy, cost, callContext, in.returnData, in.evm.depth, err)
264268
logged = true
265269
}

0 commit comments

Comments
 (0)