From 344c552f700ff44968cf6c22db06ac52d41e4a00 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Thu, 8 Jan 2026 16:19:35 +0100 Subject: [PATCH] Trie: Tame the static analyzer The CLang static analyzer claims that there might be an undefined behavior but it is provably impossible. Adding an ASSUME call to mute the warning. --- filter/trie.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/filter/trie.c b/filter/trie.c index 4edd6f2ec..2ffdf7bc9 100644 --- a/filter/trie.c +++ b/filter/trie.c @@ -1100,7 +1100,11 @@ trie_node_format(const struct f_trie_node *n, buffer *buf, int v4) uint lmask = trie_level_mask(pos, i); if ((local & lmask) != lmask) + { + /* trie_level_mask(pos, 0) == 1u << pos */ + ASSUME(i > 0); break; + } local &= ~lmask; } -- 2.47.3