From: Igor Putovny Date: Tue, 14 May 2024 12:57:47 +0000 (+0200) Subject: Add assertions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e29dd3f958011d905e8e90a23cca6046539f745;p=thirdparty%2Fbird.git Add assertions --- diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index d39a0efd6..5285c14ca 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -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];