]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: debug: unify __BUG_ON() and __BUG_ON_ONCE()
authorWilly Tarreau <w@1wt.eu>
Mon, 10 Aug 2026 18:07:01 +0000 (20:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Aug 2026 15:43:30 +0000 (17:43 +0200)
commit5960fe1d8e88b1af8cc46aeefcdb86c78b08b070
tree3f25246f32efc871798504b95a63106b7fd7d72f
parent3927f32d982f39886c3c8e33440a181598b34699
MINOR: debug: unify __BUG_ON() and __BUG_ON_ONCE()

We can do that thanks to the debug type. The line counter moved into an
if () block conditioned by the type so it continues to emit nothing for
regular bugs.

Surprizingly, the code grew by 1 kB. It's apparently caused by having
an impossible "if" statement containing a "break". Splitting the macro
in two to put the BUG_ON_ONCE() callers aside showed that having only
"if (0) break;" in the block was sufficient to make gcc deoptimize it
and result in this same growth. This was observed with 9.5. Let's
consider this a temporary limitation and keep it this way.
include/haproxy/bug.h