mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-08 12:18:42 +00:00
Add assertions
This commit is contained in:
parent
06712f5d0b
commit
4e29dd3f95
@ -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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user