Skip to content

Commit

Permalink
lyds tree BUGFIX of hash during additional sorting
Browse files Browse the repository at this point in the history
A hash must be re-inserted on additional sorting, otherwise the parent
will have the wrong reference to the first instance of the schema.

Refs #2223
  • Loading branch information
lePici committed Apr 15, 2024
1 parent 74cc126 commit 970e6f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tree_data_sorted.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,7 @@ lyds_additionally_create_rb_nodes(struct lyd_node **first_sibling, struct lyd_no
/* nodes were not sorted, they will be sorted now */
lyd_unlink_ignore_lyds(first_sibling, iter);
lyds_link_data_node(first_sibling, leader, iter, root_meta, rbn);
lyd_insert_hash(iter);
}
}

Expand Down Expand Up @@ -1142,6 +1143,7 @@ lyds_additionally_reuse_rb_tree(struct lyd_node **first_sibling, struct lyd_node
/* nodes were not sorted, they will be sorted now */
lyd_unlink_ignore_lyds(first_sibling, iter);
lyds_link_data_node(first_sibling, leader, iter, root_meta, pool->rbn);
lyd_insert_hash(iter);
}
pool->rbn = rb_iter_next(&pool->iter_state);
}
Expand Down

0 comments on commit 970e6f2

Please sign in to comment.