Fix error when merging nodes at the base of the parse stack

This commit is contained in:
Max Brunsfeld 2015-11-11 17:31:40 -08:00
parent 40a90b551a
commit 483577f00d
2 changed files with 27 additions and 0 deletions

View file

@ -124,8 +124,11 @@ static void ts_stack__add_node_successor(Stack *self, StackNode *node,
StackNode *new_successor) {
for (int i = 0; i < node->successor_count; i++) {
StackNode *successor = node->successors[i];
if (!successor)
continue;
if (successor == new_successor)
return;
if (successor->entry.state == new_successor->entry.state) {
if (successor->entry.tree != new_successor->entry.tree) {
successor->entry.tree = self->tree_selection_callback.callback(