]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: debug: make the ABORT_NOW macro use a volatile int
authorWilly Tarreau <w@1wt.eu>
Sun, 16 Dec 2018 07:17:23 +0000 (08:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 16 Dec 2018 07:17:23 +0000 (08:17 +0100)
Similar to previous commit, let's make the macro use a volatile when
dereferencing NULL so that clang doesn't optimize it away.

include/common/debug.h

index 1f84c658c9d7d83ce88bfe3217f9c5a211cd27dd..325ef8396bd9ea75f26349159fb99b139c8dbdd8 100644 (file)
@@ -40,7 +40,7 @@
 /* This abort is more efficient than abort() because it does not mangle the
  * stack and stops at the exact location we need.
  */
-#define ABORT_NOW() (*(int*)0=0)
+#define ABORT_NOW() (*(volatile int*)0=0)
 
 /* this one is provided for easy code tracing.
  * Usage: TRACE(strm||0, fmt, args...);