Merge pull request #76 from philipturnbull/remove-duplicates-oob

OOB-read in remove_duplicate_parse_states
This commit is contained in:
Max Brunsfeld 2017-06-14 07:20:09 -07:00 committed by GitHub
commit 040e225a54

View file

@ -151,7 +151,7 @@ bool ParseState::has_shift_action() const {
void ParseState::each_referenced_state(function<void(ParseStateId *)> fn) {
for (auto &entry : terminal_entries)
for (ParseAction &action : entry.second.actions)
if (action.type == ParseActionTypeShift || ParseActionTypeRecover)
if ((action.type == ParseActionTypeShift && !action.extra) || action.type == ParseActionTypeRecover)
fn(&action.state_index);
for (auto &entry : nonterminal_entries)
fn(&entry.second);