diff --git a/flow/pua/flatbuffers_builder.go b/flow/pua/flatbuffers_builder.go index 024c1d0a1c..91afbccc84 100644 --- a/flow/pua/flatbuffers_builder.go +++ b/flow/pua/flatbuffers_builder.go @@ -160,7 +160,7 @@ func (b *Builder) WriteVtable(ls *lua.LState) int { } var existingVtable int - for i := len(b.ba.data) - 1; i >= 0; i-- { + for i := len(b.vtables) - 1; i >= 0; i -= 1 { vt2Offset := b.vtables[i] vt2Start := len(b.ba.data) - vt2Offset vt2Len := uint16n.UnpackU64(b.ba.data[vt2Start:]) @@ -176,7 +176,7 @@ func (b *Builder) WriteVtable(ls *lua.LState) int { } if existingVtable == 0 { - for i := len(b.currentVT) - 1; i >= 0; i-- { + for i := len(b.currentVT) - 1; i >= 0; i -= 1 { var off uint16 if b.currentVT[i] != 0 { off = uint16(objectOffset - b.currentVT[i])