]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Add assertions
authorIgor Putovny <igor.putovny@nic.cz>
Tue, 14 May 2024 12:57:47 +0000 (14:57 +0200)
committerIgor Putovny <igor.putovny@nic.cz>
Thu, 30 May 2024 10:30:00 +0000 (12:30 +0200)
proto/aggregator/aggregator.c

index d39a0efd6dbf8e6f9b2ae7a0eb38f31756759af7..5285c14caf2e8fe72c6a8f4833416c0f336e6ef2 100644 (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];