]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: debug: make __BUG_ON() use abort_with_line()
authorWilly Tarreau <w@1wt.eu>
Tue, 11 Aug 2026 15:20:21 +0000 (17:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Aug 2026 15:43:30 +0000 (17:43 +0200)
ABORT_NOW() with no arg is strictly equivalent to abort_with_line(__LINE__)
so let's do it explicitly, not only it clarifies the code, but it
also reduces the size of the developed macros, which does count,
considering the number of BUG_ON() in the code.

include/haproxy/bug.h

index 8d7776224e555eb33e7a616fa1bf0ca9eaff9819..f78dadcf4899d889d59b8c35c2c597e3a143679b 100644 (file)
@@ -370,7 +370,7 @@ extern __attribute__((__weak__)) struct debug_count __stop_dbg_cnt  HA_SECTION_S
                        if (_details & (DBG_DET_FAT_FATL|DBG_DET_FAT_WARN))     \
                                ha_backtrace_to_stderr(!!(_details & DBG_DET_FAT_FATL)); \
                        if (_details & DBG_DET_FAT_FATL)                        \
-                               ABORT_NOW();                                    \
+                               abort_with_line(__LINE__);                      \
                }                                                               \
        }
 
@@ -430,7 +430,7 @@ extern __attribute__((__weak__)) struct debug_count __stop_dbg_cnt  HA_SECTION_S
                        if (details & (DBG_DET_FAT_FATL|DBG_DET_FAT_WARN)) \
                                ha_backtrace_to_stderr(!!(details & DBG_DET_FAT_FATL)); \
                        if (details & DBG_DET_FAT_FATL)                 \
-                               ABORT_NOW();                            \
+                               abort_with_line(__LINE__);              \
                }                                                       \
        }