From 67f32882c431252072b61ba798dd3dba7328ae78 Mon Sep 17 00:00:00 2001 From: Igor Putovny Date: Fri, 24 Jan 2025 15:13:43 +0100 Subject: [PATCH] Add more checks --- proto/aggregator/aggregator.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index a60de6c95..98fc3bdab 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -779,6 +779,19 @@ check_ancestors_after_aggregation(const struct trie_node *node) check_ancestors_after_aggregation(node->child[1]); } +static void +assert_trie(const struct trie_node *node) +{ + assert(node != NULL); + assert(node->original_bucket != NULL); + + if (node->child[0]) + assert_trie(node->child[0]); + + if (node->child[1]) + assert_trie(node->child[1]); +} + /* * Merge sets of potential buckets going from @node upwards. * Stop when sets don't change and return the last updated node. -- 2.47.2