summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Evgenii Stepanov <eugenis@google.com> 2015-07-15 17:40:14 -0700
committer Evgenii Stepanov <eugenis@google.com> 2015-07-15 19:30:08 -0700
commit0f2fd32a4f86e305b1410c8da0c784c3756bc92d (patch)
tree6f4449a7273d75641b1f954ed31410e8d3a04301
parent34ac23dc965bf6ca24dd2e9bb115f66ff1fc191e (diff)
Enable ASan annotations in ART based on macro setting.
This is a quick hack to remove ASan annotations from SANITIZE_TARGET build, because they are breaking everything - it looks like we forget to clean redzones from a page before releasing it to the system, and some unrelated code runs into them later. We will add some way to control this from the build system later, or just fix the underlying issue and re-enable by default. Bug: 21785137 Change-Id: If79e2455e246dc39355f2758323b249ac20b6144
-rw-r--r--runtime/base/memory_tool.h8
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;