|
11 | 11 |
|
12 | 12 | #include "src/__support/macros/config.h" //LIBC_HAS_FEATURE
|
13 | 13 |
|
14 |
| -//----------------------------------------------------------------------------- |
15 |
| -// Properties to check the presence or absence or sanitizers |
16 |
| -//----------------------------------------------------------------------------- |
17 |
| - |
18 |
| -// MemorySanitizer (MSan) is a detector of uninitialized reads. It consists of |
19 |
| -// a compiler instrumentation module and a run-time library. The |
20 |
| -// MEMORY_SANITIZER macro is deprecated but we will continue to honor it for |
21 |
| -// now. |
22 |
| -#ifdef LIBC_HAVE_MEMORY_SANITIZER |
23 |
| -#error "LIBC_HAVE_MEMORY_SANITIZER cannot be directly set." |
24 |
| -#elif defined(MEMORY_SANITIZER) || defined(__SANITIZE_MEMORY__) || \ |
25 |
| - (LIBC_HAS_FEATURE(memory_sanitizer) && !defined(__native_client__)) |
26 |
| -#define LIBC_HAVE_MEMORY_SANITIZER |
27 |
| -#endif |
28 |
| - |
29 |
| -// AddressSanitizer (ASan) is a fast memory error detector. The |
30 |
| -// ADDRESS_SANITIZER macro is deprecated but we will continue to honor it for |
31 |
| -// now. |
32 |
| -#ifdef LIBC_HAVE_ADDRESS_SANITIZER |
33 |
| -#error "LIBC_HAVE_ADDRESS_SANITIZER cannot be directly set." |
34 |
| -#elif defined(ADDRESS_SANITIZER) || defined(__SANITIZE_ADDRESS__) || \ |
35 |
| - LIBC_HAS_FEATURE(address_sanitizer) |
36 |
| -#define LIBC_HAVE_ADDRESS_SANITIZER |
37 |
| -#endif |
38 |
| - |
39 |
| -// HWAddressSanitizer (HWASan) is a fast, low memory overhead error detector. |
40 |
| -#ifdef LIBC_HAVE_HWADDRESS_SANITIZER |
41 |
| -#error "LIBC_HAVE_HWADDRESS_SANITIZER cannot be directly set." |
42 |
| -#elif LIBC_HAS_FEATURE(hwaddress_sanitizer) |
43 |
| -#define LIBC_HAVE_HWADDRESS_SANITIZER |
44 |
| -#endif |
45 |
| - |
46 | 14 | //-----------------------------------------------------------------------------
|
47 | 15 | // Functions to unpoison memory
|
48 | 16 | //-----------------------------------------------------------------------------
|
49 | 17 |
|
50 |
| -#if defined(LIBC_HAVE_MEMORY_SANITIZER) |
| 18 | +#if LIBC_HAS_FEATURE(memory_sanitizer) |
51 | 19 | // Only perform MSAN unpoison in non-constexpr context.
|
52 | 20 | #include <sanitizer/msan_interface.h>
|
53 | 21 | #define MSAN_UNPOISON(addr, size) \
|
|
59 | 27 | #define MSAN_UNPOISON(ptr, size)
|
60 | 28 | #endif
|
61 | 29 |
|
62 |
| -#ifdef LIBC_HAVE_ADDRESS_SANITIZER |
| 30 | +#if LIBC_HAS_FEATURE(address_sanitizer) |
63 | 31 | #include <sanitizer/asan_interface.h>
|
64 | 32 | #define ASAN_POISON_MEMORY_REGION(addr, size) \
|
65 | 33 | __asan_poison_memory_region((addr), (size))
|
|
0 commit comments