Skip to content

Commit

Permalink
fix(gnovm): zero-in Ops and Values correctly in (*Machine).Release (#894
Browse files Browse the repository at this point in the history
)
  • Loading branch information
thehowl authored Jun 15, 2023
1 parent 99633b9 commit 232754d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gnovm/pkg/gnolang/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ func (m *Machine) Release() {
m.NumOps = 0
m.NumValues = 0
// this is the fastest way to zero-in a slice in Go
copy(m.Ops, opZeroed[:0])
copy(m.Values, valueZeroed[:0])
copy(m.Ops, opZeroed[:])
copy(m.Values, valueZeroed[:])

machinePool.Put(m)
}
Expand Down

0 comments on commit 232754d

Please sign in to comment.