Fix assertion in PredictionContext.mergeArrays

This commit is contained in:
Sam Harwell 2012-10-14 22:40:34 -05:00
parent 7c221f13ed
commit aa2223cd6a
1 changed files with 1 additions and 1 deletions

View File

@ -331,7 +331,7 @@ public abstract class PredictionContext implements Iterable<SingletonPredictionC
int p = lastSlot; // walk backwards from last index until we find non-null parent int p = lastSlot; // walk backwards from last index until we find non-null parent
while ( p>=0 && mergedParents[p]==null ) { p--; } while ( p>=0 && mergedParents[p]==null ) { p--; }
// p is now last non-null index // p is now last non-null index
assert p>0; // could only happen to be <0 if two arrays with $ assert p>=0; // could only happen to be <0 if two arrays with $
if ( p < lastSlot ) { if ( p < lastSlot ) {
int n = p+1; // how many slots we really used in merge int n = p+1; // how many slots we really used in merge
if ( n == 1 ) { // for just one merged element, return singleton top if ( n == 1 ) { // for just one merged element, return singleton top