]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid build failure when building without -fsanitize=address. feature/asan-gc-poisoning
authorVibhav Pant <vibhavp@gmail.com>
Sun, 18 Dec 2022 14:55:55 +0000 (20:25 +0530)
committerVibhav Pant <vibhavp@gmail.com>
Sun, 18 Dec 2022 14:55:55 +0000 (20:25 +0530)
* src/lisp.h (UNALIGNED_LOAD_SIZE): Only use the sanitizer version of
the macro when USE_SANITIZER_UNALIGNED_LOAD is defined, avoiding link
errors when building without -fsanitize=address.

src/lisp.h

index f466d4b0da59de275933137866a5c201341b6f26..be511a0eb9c0341444305a4dcbe7add70fcd3a7a 100644 (file)
@@ -5296,8 +5296,12 @@ __lsan_ignore_object (void const *p)
 }
 #endif
 
+/* If built with USE_SANITIZER_UNALIGNED_LOAD defined, use compiler
+   provided ASan functions to perform unaligned loads, allowing ASan
+   to catch bugs which it might otherwise miss.  */
 #if defined HAVE_SANITIZER_COMMON_INTERFACE_DEFS_H \
-  && defined ADDRESS_SANITIZER
+  && defined ADDRESS_SANITIZER                     \
+  && defined USE_SANITIZER_UNALIGNED_LOAD
 # include <sanitizer/common_interface_defs.h>
 # if (SIZE_MAX == UINT64_MAX)
 #  define UNALIGNED_LOAD_SIZE(a, i) \