fixed a memleak ( "previous' was not deleted when one of the break statements was hit)

This commit is contained in:
Floor 2017-04-05 10:44:48 +02:00
parent 96cee174ce
commit ea3d9d8fb4
1 changed files with 3 additions and 3 deletions

View File

@ -357,6 +357,9 @@ size_t ParserATNSimulator::execATNWithFullContext(dfa::DFA &dfa, dfa::DFAState *
}
throw e;
}
if (previous != s0) // Don't delete the start set.
delete previous;
previous = nullptr;
std::vector<BitSet> altSubSets = PredictionModeClass::getConflictingAltSubsets(reach.get());
reach->uniqueAlt = getUniqueAlt(reach.get());
@ -382,9 +385,6 @@ size_t ParserATNSimulator::execATNWithFullContext(dfa::DFA &dfa, dfa::DFAState *
// we're not sure what the ambiguity is yet.
// So, keep going.
}
if (previous != s0) // Don't delete the start set.
delete previous;
previous = reach.release();
if (t != Token::EOF) {