From 919c9d871576f569bb9a0ff85d1fd742a26c1888 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 19 Jan 2018 17:29:20 -0800 Subject: [PATCH] Ensure root node has a null parent --- src/runtime/tree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/runtime/tree.c b/src/runtime/tree.c index 5794a427..49d9b3a1 100644 --- a/src/runtime/tree.c +++ b/src/runtime/tree.c @@ -204,6 +204,7 @@ Tree *ts_tree_make_copy(TreePool *pool, Tree *self) { } void ts_tree_assign_parents(Tree *self, TreePool *pool, const TSLanguage *language) { + self->context.parent = NULL; array_clear(&pool->tree_stack); array_push(&pool->tree_stack, self); while (pool->tree_stack.size > 0) {