summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/malloc_debug.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-05-25 23:11:20 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-05-25 23:11:20 +0000
commit848e1d8a30a3465040edc27085927309fe6cbcff (patch)
tree03c1b6a86306f0c5624ebee660f19389484df699 /libc/malloc_debug/malloc_debug.cpp
parentbdc1d1886a1ba79b89a94895c26f0796156af46a (diff)
parente8ba38752235fe165715de9fdb3e8fb8489bd00e (diff)
Snap for 5605895 from e8ba38752235fe165715de9fdb3e8fb8489bd00e to rvc-release
Change-Id: I83b02af5bb1b2fa7e50a55c723d83b6697a36c9c
Diffstat (limited to 'libc/malloc_debug/malloc_debug.cpp')
-rw-r--r--libc/malloc_debug/malloc_debug.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libc/malloc_debug/malloc_debug.cpp b/libc/malloc_debug/malloc_debug.cpp
index 53fcead01..c030d5429 100644
--- a/libc/malloc_debug/malloc_debug.cpp
+++ b/libc/malloc_debug/malloc_debug.cpp
@@ -252,12 +252,19 @@ static void* InitHeader(Header* header, void* orig_pointer, size_t size) {
return g_debug->GetPointer(header);
}
+extern "C" void __asan_init() __attribute__((weak));
+
bool debug_initialize(const MallocDispatch* malloc_dispatch, bool* zygote_child,
const char* options) {
if (zygote_child == nullptr || options == nullptr) {
return false;
}
+ if (__asan_init != 0) {
+ error_log("malloc debug cannot be enabled alongside ASAN");
+ return false;
+ }
+
InitAtfork();
g_zygote_child = zygote_child;