diff options
| author | 2015-07-16 02:54:54 +0000 | |
|---|---|---|
| committer | 2015-07-16 02:54:55 +0000 | |
| commit | 2e7ccf9aeb7212c96e2081b66f85b67856b8825a (patch) | |
| tree | 6f4449a7273d75641b1f954ed31410e8d3a04301 | |
| parent | 34ac23dc965bf6ca24dd2e9bb115f66ff1fc191e (diff) | |
| parent | 0f2fd32a4f86e305b1410c8da0c784c3756bc92d (diff) | |
Merge "Enable ASan annotations in ART based on macro setting."
| -rw-r--r-- | runtime/base/memory_tool.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/base/memory_tool.h b/runtime/base/memory_tool.h index 31162a3baa..e0bdcfeced 100644 --- a/runtime/base/memory_tool.h +++ b/runtime/base/memory_tool.h @@ -27,9 +27,17 @@ #include <sanitizer/asan_interface.h> #define ADDRESS_SANITIZER + +#ifdef ART_ENABLE_ADDRESS_SANITIZER #define MEMORY_TOOL_MAKE_NOACCESS(p, s) __asan_poison_memory_region(p, s) #define MEMORY_TOOL_MAKE_UNDEFINED(p, s) __asan_unpoison_memory_region(p, s) #define MEMORY_TOOL_MAKE_DEFINED(p, s) __asan_unpoison_memory_region(p, s) +#else +#define MEMORY_TOOL_MAKE_NOACCESS(p, s) do { (void)(p); (void)(s); } while (0) +#define MEMORY_TOOL_MAKE_UNDEFINED(p, s) do { (void)(p); (void)(s); } while (0) +#define MEMORY_TOOL_MAKE_DEFINED(p, s) do { (void)(p); (void)(s); } while (0) +#endif + #define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) #define RUNNING_ON_MEMORY_TOOL 1U constexpr bool kMemoryToolIsValgrind = false; |