0
0
Fork 0

fix bug introduced by reuse of TermFrequencyRow values

in a recent commit, we changed the code to reuse
TermFrequencyRow objects intsead of constantly allocating new
ones.  unfortunately, one of the original methods was not coded
with this reuse in mind, and a lazy initialization cause us to
leak data from previous uses of the same object.

in particular this caused term vector information from previous
hits to still be applied to subsequent hits.  eventually this
causes the highlighter to try and highlight invalid regions
of a slice.

fixes #404
This commit is contained in:
Marty Schoch 2016-08-05 08:33:04 -04:00
parent 389e18a779
commit da794d3762
1 changed files with 1 additions and 0 deletions

View File

@ -544,6 +544,7 @@ func (tfr *TermFrequencyRow) parseV(value []byte) error {
tfr.norm = math.Float32frombits(uint32(norm))
tfr.vectors = nil
var field uint64
field, bytesRead = binary.Uvarint(value[currOffset:])
for bytesRead > 0 {