fix null ptr

This commit is contained in:
Terence Parr 2012-08-03 16:56:41 -07:00
parent 86e47b9c02
commit 95f5d858cb
1 changed files with 4 additions and 2 deletions

View File

@ -686,8 +686,10 @@ public class ParserATNSimulator<Symbol extends Token> extends ATNSimulator {
// pairs if preds found for conflicting alts
IntervalSet altsToCollectPredsFrom = getConflictingAltsOrUniqueAlt(D.configs);
SemanticContext[] altToPred = getPredsForAmbigAlts(altsToCollectPredsFrom, D.configs, nalts);
D.predicates = getPredicatePredictions(altsToCollectPredsFrom, altToPred);
D.prediction = ATN.INVALID_ALT_NUMBER; // make sure we use preds
if ( altToPred!=null ) {
D.predicates = getPredicatePredictions(altsToCollectPredsFrom, altToPred);
D.prediction = ATN.INVALID_ALT_NUMBER; // make sure we use preds
}
if ( D.predicates!=null ) {
int stopIndex = input.index();