]> git.ipfire.org Git - thirdparty/haproxy.git/commit
IMPORT: ebtree: Fix UB from clz(0)
authorBen Kallus <benjamin.p.kallus.gr@dartmouth.edu>
Sat, 13 Sep 2025 12:00:03 +0000 (14:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 Sep 2025 12:30:32 +0000 (14:30 +0200)
commitddbff4e2358a89c67bd10ad3dd6cef88cf78f368
treed5dd42af46912009f1caf5d1f5e3364837302a7c
parent52c6dd773d5e49d9506844e5cc14762933068564
IMPORT: ebtree: Fix UB from clz(0)

From 'man gcc': passing 0 as the argument to "__builtin_ctz" or
"__builtin_clz" invokes undefined behavior. This triggers UBsan
in HAProxy.

[wt: tested in treebench and verified not to cause any performance
 regression with opstime-u32 nor stress-u32]
Signed-off-by: Willy Tarreau <w@1wt.eu>
This is ebtree commit 8c29daf9fa6e34de8c7684bb7713e93dcfe09029.
Signed-off-by: Willy Tarreau <w@1wt.eu>
This is ebtree commit cf3b93736cb550038325e1d99861358d65f70e9a.
include/import/eb32tree.h