Skip to content

Commit

Permalink
minor improvements to trace execution
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-pino committed Sep 1, 2023
1 parent 76a574f commit ce855a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/vm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ func (vm *VirtualMachine) Proof() ([]Context, []*f.Element, error) {

// update pc, fp and ap to be their real value
// that is, pc_i + 0, ap + len(programBytecode), fp + len(programBytecode)
totalBytecode := vm.MemoryManager.Memory.Segments[programSegment].Len()
for i := range vm.Trace {
vm.Trace[i].Ap += vm.MemoryManager.Memory.Segments[programSegment].Len()
vm.Trace[i].Fp += vm.MemoryManager.Memory.Segments[programSegment].Len()
vm.Trace[i].Ap += totalBytecode
vm.Trace[i].Fp += totalBytecode
}

// after that, get the relocated memory
Expand Down

0 comments on commit ce855a8

Please sign in to comment.