Skip to content

Commit

Permalink
Tracer should only fetch the currently active stack. (#1085)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazartravica committed Jan 10, 2023
1 parent 25f36e5 commit ae79516
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions state/runtime/tracer/structtracer/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (t *StructTracer) CaptureState(

t.captureMemory(memory)

t.captureStack(stack)
t.captureStack(stack, sp)

t.captureStorage(
stack,
Expand All @@ -169,14 +169,19 @@ func (t *StructTracer) captureMemory(

func (t *StructTracer) captureStack(
stack []*big.Int,
sp int,
) {
if !t.Config.EnableStack {
return
}

t.currentStack = make([]*big.Int, len(stack))
t.currentStack = make([]*big.Int, sp)

for i, v := range stack {
if i >= sp {
break
}

t.currentStack[i] = new(big.Int).Set(v)
}
}
Expand Down

0 comments on commit ae79516

Please sign in to comment.