Fix stack breakdown procedure when there are trailing extra tokens
This commit is contained in:
parent
e70547cd11
commit
ecc7399ed3
2 changed files with 29 additions and 3 deletions
|
|
@ -231,14 +231,17 @@ INLINE StackPopResult stack__iter(Stack *self, StackVersion version,
|
|||
}
|
||||
|
||||
next_path->node = link.node;
|
||||
if (!link.is_pending)
|
||||
next_path->is_pending = false;
|
||||
if (link.tree) {
|
||||
if (!link.tree->extra)
|
||||
if (!link.tree->extra) {
|
||||
next_path->tree_count++;
|
||||
if (!link.is_pending)
|
||||
next_path->is_pending = false;
|
||||
}
|
||||
if (!array_push(&next_path->trees, link.tree))
|
||||
goto error;
|
||||
ts_tree_retain(link.tree);
|
||||
} else {
|
||||
next_path->is_pending = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue