]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Don't Even Declare Poisoning Functions if Poisoning is Disabled 3424/head
authorW. Felix Handte <w@felixhandte.com>
Fri, 13 Jan 2023 16:56:48 +0000 (11:56 -0500)
committerW. Felix Handte <w@felixhandte.com>
Fri, 13 Jan 2023 16:56:48 +0000 (11:56 -0500)
This guarantees that we won't accidentally forget to check the macro somewhere
where we use these functions.

lib/common/compiler.h

index 4ad55e601e60a208a111b4ec748dbecd6eb4d4be..d4f2f285d792dc16685ef777b9b7c6ea96af843e 100644 (file)
 #endif
 #endif
 
-#if ZSTD_MEMORY_SANITIZER
+#if ZSTD_MEMORY_SANITIZER && !defined(ZSTD_MSAN_DONT_POISON_WORKSPACE)
 /* Not all platforms that support msan provide sanitizers/msan_interface.h.
  * We therefore declare the functions we need ourselves, rather than trying to
  * include the header file... */
@@ -313,7 +313,7 @@ void __msan_poison(const volatile void *a, size_t size);
 intptr_t __msan_test_shadow(const volatile void *x, size_t size);
 #endif
 
-#if ZSTD_ADDRESS_SANITIZER
+#if ZSTD_ADDRESS_SANITIZER && !defined(ZSTD_ASAN_DONT_POISON_WORKSPACE)
 /* Not all platforms that support asan provide sanitizers/asan_interface.h.
  * We therefore declare the functions we need ourselves, rather than trying to
  * include the header file... */