]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DEBUG: mark ABORT_NOW() as unreachable
authorWilly Tarreau <w@1wt.eu>
Fri, 25 Feb 2022 08:01:36 +0000 (09:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 25 Feb 2022 10:55:47 +0000 (11:55 +0100)
The purpose is to make the program die at this point, so let's help the
compiler optimise the code (especially in sensitive areas) by telling it
that ABORT_NOW() does not return. This reduces the overall code size by
~0.5%.

include/haproxy/bug.h

index ddf55e8057e719aebf51b691f53f06d0bd871019..4cedbf11f7db6d5bdf89498019fe60e7fd4bf25c 100644 (file)
@@ -47,7 +47,7 @@
 /* More efficient than abort() because it does not mangle the
   * stack and stops at the exact location we need.
   */
-#define ABORT_NOW() do { DUMP_TRACE(); (*(volatile int*)1=0); } while (0)
+#define ABORT_NOW() do { DUMP_TRACE(); (*(volatile int*)1=0); my_unreachable(); } while (0)
 #endif
 
 /* This is the generic low-level macro dealing with conditional warnings and