aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-04-20 22:18:49 -0700
committerElliott Hughes <enh@google.com>2019-04-22 07:51:39 -0700
commit5bab966ca807b95ca8be32a71cc7cecc36b62106 (patch)
tree798fdebdba1a3e74be829e54a2d800af643f5246
parent2601d434599fc830d7a8d1965fd8e27519e520fb (diff)
downloadandroid_bionic-5bab966ca807b95ca8be32a71cc7cecc36b62106.tar.gz
android_bionic-5bab966ca807b95ca8be32a71cc7cecc36b62106.tar.bz2
android_bionic-5bab966ca807b95ca8be32a71cc7cecc36b62106.zip
Workaround ASan not knowing about reallocarray.
Ensure we call realloc@plt rather than (as was previously happening) inlining realloc into reallocarray, which makes the allocation invisible to ASan. Bug: http://b/129989984 Test: objdump (cherry picked from commit 390be50067c03524b420cae83fd97992f26fa754) Change-Id: I0676b70cb9a7d7323252eabfff055c0e806915ef
-rw-r--r--libc/bionic/malloc_common.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/bionic/malloc_common.cpp b/libc/bionic/malloc_common.cpp
index 60ee138c7..9dc4d12d1 100644
--- a/libc/bionic/malloc_common.cpp
+++ b/libc/bionic/malloc_common.cpp
@@ -155,7 +155,7 @@ extern "C" void* aligned_alloc(size_t alignment, size_t size) {
return result;
}
-extern "C" void* realloc(void* old_mem, size_t bytes) {
+extern "C" __attribute__((__noinline__)) void* realloc(void* old_mem, size_t bytes) {
auto dispatch_table = GetDispatchTable();
if (__predict_false(dispatch_table != nullptr)) {
return dispatch_table->realloc(old_mem, bytes);