0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

Add assertions

This commit is contained in:
Igor Putovny 2024-05-14 14:57:47 +02:00
parent 06712f5d0b
commit 4e29dd3f95

View File

@ -223,6 +223,10 @@ first_pass_new(struct trie_node *node, slab *trie_slab)
return;
}
/* Root node */
if (node->parent == NULL)
assert(node->bucket != NULL);
if (node->bucket == NULL)
node->bucket = node->parent->bucket;
@ -496,6 +500,9 @@ second_pass(struct trie_node *node)
return;
}
/* Internal node */
assert(node->potential_buckets_count == 0);
struct trie_node * const left = node->child[0];
struct trie_node * const right = node->child[1];