add assertion to check that skip pointer isn't past EOF

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1062810 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-01-24 14:51:15 +00:00
parent ce53019db5
commit 924e745b06
1 changed files with 2 additions and 0 deletions

View File

@ -172,6 +172,8 @@ public abstract class MultiLevelSkipListReader {
public void init(long skipPointer, int df) { public void init(long skipPointer, int df) {
this.skipPointer[0] = skipPointer; this.skipPointer[0] = skipPointer;
this.docCount = df; this.docCount = df;
assert skipPointer >= 0 && skipPointer <= skipStream[0].length()
: "invalid skip pointer: " + skipPointer + ", length=" + skipStream[0].length();
Arrays.fill(skipDoc, 0); Arrays.fill(skipDoc, 0);
Arrays.fill(numSkipped, 0); Arrays.fill(numSkipped, 0);
Arrays.fill(childPointer, 0); Arrays.fill(childPointer, 0);