You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/10/17 18:07:50 UTC

[GitHub] [lucene] dnhatn commented on a change in pull request #389: LUCENE-10159: Fix invalid access in sorted set dv

dnhatn commented on a change in pull request #389:
URL: https://github.com/apache/lucene/pull/389#discussion_r730454030



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesProducer.java
##########
@@ -1402,15 +1403,23 @@ public int docID() {
       @Override
       public int nextDoc() throws IOException {
         int doc = ords.nextDoc();
-        count = ords.docValueCount();
+        if (doc != NO_MORE_DOCS) {
+          count = ords.docValueCount();
+        } else {
+          count = 0;
+        }
         i = 0;
         return doc;
       }
 
       @Override
       public int advance(int target) throws IOException {
         int doc = ords.advance(target);
-        count = ords.docValueCount();
+        if (doc != NO_MORE_DOCS) {
+          count = ords.docValueCount();
+        } else {
+          count = 0;
+        }

Review comment:
       Thanks @rmuir. Yes, it should be okay if we write 8 extra trailing `0` (for the worst case where we use `DirectPackedReader64` to store ordinals). WDYT?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org