Merge pull request #3086 from tree-sitter/randomized-test-crash-stack-merge
Fix invalid parse stack recursive merging with mismatched error cost
This commit is contained in:
commit
c03c773a24
1 changed files with 2 additions and 1 deletions
|
|
@ -228,7 +228,8 @@ static void stack_node_add_link(
|
|||
// If the previous nodes are mergeable, merge them recursively.
|
||||
if (
|
||||
existing_link->node->state == link.node->state &&
|
||||
existing_link->node->position.bytes == link.node->position.bytes
|
||||
existing_link->node->position.bytes == link.node->position.bytes &&
|
||||
existing_link->node->error_cost == link.node->error_cost
|
||||
) {
|
||||
for (int j = 0; j < link.node->link_count; j++) {
|
||||
stack_node_add_link(existing_link->node, link.node->links[j], subtree_pool);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue