| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WTF_AddressSanitizer_h | 5 #ifndef WTF_AddressSanitizer_h |
| 6 #define WTF_AddressSanitizer_h | 6 #define WTF_AddressSanitizer_h |
| 7 // TODO(kojii): This file will need to be renamed, because it's no more | 7 // TODO(kojii): This file will need to be renamed, because it's no more |
| 8 // specific to AddressSanitizer. | 8 // specific to AddressSanitizer. |
| 9 | 9 |
| 10 #include "wtf/build_config.h" | 10 #include "wtf/build_config.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #else | 22 #else |
| 23 #define __lsan_register_root_region(addr, size) ((void)(addr), (void)(size)) | 23 #define __lsan_register_root_region(addr, size) ((void)(addr), (void)(size)) |
| 24 #define __lsan_unregister_root_region(addr, size) ((void)(addr), (void)(size)) | 24 #define __lsan_unregister_root_region(addr, size) ((void)(addr), (void)(size)) |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 #if defined(MEMORY_SANITIZER) | 27 #if defined(MEMORY_SANITIZER) |
| 28 #include <sanitizer/msan_interface.h> | 28 #include <sanitizer/msan_interface.h> |
| 29 #endif | 29 #endif |
| 30 | 30 |
| 31 // TODO(sof): Have to handle (ADDRESS_SANITIZER && _WIN32) differently as it | 31 // TODO(sof): Have to handle (ADDRESS_SANITIZER && _WIN32) differently as it |
| 32 // uses both Clang (which supports the __attribute__ syntax) and CL (which doesn
't) | 32 // uses both Clang (which supports the __attribute__ syntax) and CL (which |
| 33 // as long as we use "clang-cl /fallback". This shouldn't be needed when Clang | 33 // doesn't) as long as we use "clang-cl /fallback". This shouldn't be needed |
| 34 // handles all the code without falling back to CL. | 34 // when Clang handles all the code without falling back to CL. |
| 35 #if defined(ADDRESS_SANITIZER) && (!OS(WIN) || COMPILER(CLANG)) | 35 #if defined(ADDRESS_SANITIZER) && (!OS(WIN) || COMPILER(CLANG)) |
| 36 #define NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) | 36 #define NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) |
| 37 #define NO_LAZY_SWEEP_SANITIZE_ADDRESS NO_SANITIZE_ADDRESS | 37 #define NO_LAZY_SWEEP_SANITIZE_ADDRESS NO_SANITIZE_ADDRESS |
| 38 #else | 38 #else |
| 39 #define NO_SANITIZE_ADDRESS | 39 #define NO_SANITIZE_ADDRESS |
| 40 #define NO_LAZY_SWEEP_SANITIZE_ADDRESS | 40 #define NO_LAZY_SWEEP_SANITIZE_ADDRESS |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 #if defined(MEMORY_SANITIZER) && (!OS(WIN) || COMPILER(CLANG)) | 43 #if defined(MEMORY_SANITIZER) && (!OS(WIN) || COMPILER(CLANG)) |
| 44 #define NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory)) | 44 #define NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory)) |
| 45 #else | 45 #else |
| 46 #define NO_SANITIZE_MEMORY | 46 #define NO_SANITIZE_MEMORY |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 #if defined(THREAD_SANITIZER) && (!OS(WIN) || COMPILER(CLANG)) | 49 #if defined(THREAD_SANITIZER) && (!OS(WIN) || COMPILER(CLANG)) |
| 50 #define NO_SANITIZE_THREAD __attribute__((no_sanitize_thread)) | 50 #define NO_SANITIZE_THREAD __attribute__((no_sanitize_thread)) |
| 51 #else | 51 #else |
| 52 #define NO_SANITIZE_THREAD | 52 #define NO_SANITIZE_THREAD |
| 53 #endif | 53 #endif |
| 54 | 54 |
| 55 #endif // WTF_AddressSanitizer_h | 55 #endif // WTF_AddressSanitizer_h |
| OLD | NEW |