ART: Enforce noinline when suppressing sanitization
The no_sanitize_address attribute is dropped on inlining. Add a
hackish noinline to the macro that will override always_inline.
When Clang starts to warn on nonsensical attribute lists (e.g.,
always_inline + noinline), we will have to find a better way. For
now, avoid churn.
Bug: 117207477
Test: SANITIZE_TARGET=address build, no longer see aborts
Change-Id: I967deb851a5b3716ea6b251932245e2af1530087
diff --git a/libartbase/base/memory_tool.h b/libartbase/base/memory_tool.h
index d381f01..1a6a9bb 100644
--- a/libartbase/base/memory_tool.h
+++ b/libartbase/base/memory_tool.h
@@ -44,7 +44,7 @@
extern "C" void __asan_handle_no_return();
-# define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
+# define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address, noinline))
# define MEMORY_TOOL_HANDLE_NO_RETURN __asan_handle_no_return()
constexpr bool kRunningOnMemoryTool = true;
constexpr bool kMemoryToolDetectsLeaks = true;