From 7213cc08f31bd172317c366af0e2c9d08cb58c58 Mon Sep 17 00:00:00 2001 From: Igor Putovny Date: Fri, 6 Oct 2023 14:19:04 +0200 Subject: [PATCH] Fix incorrect implementation of the third pass --- proto/aggregator/aggregator.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index 5bd89a65..d8f16851 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -470,6 +470,7 @@ third_pass(struct trie_node *node) { assert(node->potential_buckets_count > 0); node->bucket = node->potential_buckets[0]; + goto descent; } const struct aggregator_bucket *inherited_bucket = get_ancestor_bucket(node); @@ -490,8 +491,9 @@ third_pass(struct trie_node *node) } /* Postorder traversal */ - third_pass(node->child[0]); - third_pass(node->child[1]); + descent: + third_pass(node->child[0]); + third_pass(node->child[1]); /* Leaves with no assigned bucket are removed */ if (node->bucket == NULL && is_leaf(node))