bugfix in the C runtime that shows up with only some grammars

This commit is contained in:
kr.angelov
2014-04-08 12:41:41 +00:00
parent 581a0336a5
commit 52377b46cf

View File

@@ -1148,7 +1148,8 @@ pgf_parsing_lookahead(PgfParsing *ps, PgfParseState* state)
{
PgfSequence* epsilon_seq =
gu_seq_index(ps->concr->sequences, PgfSequence, 0);
if (gu_seq_length(epsilon_seq->syms) == 0) {
if (gu_seq_length(epsilon_seq->syms) == 0 &&
epsilon_seq->idx != NULL) {
// Since the sequences are sorted, the epsilon sequence will
// always be the first if there is any at all. We should
// always add the epsilon in the index, because we do