Ensure 'extra' bit is set correctly when reusing a node

Fixes #1444
This commit is contained in:
Max Brunsfeld 2021-11-19 12:16:28 -08:00
parent 2f9b7ac465
commit 4e2e059865
2 changed files with 9 additions and 11 deletions

View file

@ -187,11 +187,11 @@ static inline size_t ts_subtree_alloc_size(uint32_t child_count) {
#define ts_subtree_children(self) \
((self).data.is_inline ? NULL : (Subtree *)((self).ptr) - (self).ptr->child_count)
static inline void ts_subtree_set_extra(MutableSubtree *self) {
static inline void ts_subtree_set_extra(MutableSubtree *self, bool is_extra) {
if (self->data.is_inline) {
self->data.extra = true;
self->data.extra = is_extra;
} else {
self->ptr->extra = true;
self->ptr->extra = is_extra;
}
}