v4: Can't add a DFA edge for token types < -1 (EOF)

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9269]
This commit is contained in:
sharwell 2011-11-09 10:18:54 -08:00
parent 783c3b2e50
commit 3ca6ab034d
1 changed files with 1 additions and 1 deletions

View File

@ -771,7 +771,7 @@ public class ParserATNSimulator extends ATNSimulator {
}
protected void addDFAEdge(DFAState p, int t, DFAState q) {
if ( p==null ) return;
if ( p==null || t < -1 ) return;
if ( p.edges==null ) {
p.edges = new DFAState[atn.maxTokenType+1+1]; // TODO: make adaptive
}