summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2016-01-14 00:04:37 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2016-01-14 00:04:37 +0000
commit38b3130c7aa8e4f40949cd3001a75b4d2fcda540 (patch)
tree9733f064547985ef299f2e37658153447ce70e76
parent9de6d7becc82f1e7f0d76b3124d52cd20a96d601 (diff)
downloadbcm5719-llvm-38b3130c7aa8e4f40949cd3001a75b4d2fcda540.tar.gz
bcm5719-llvm-38b3130c7aa8e4f40949cd3001a75b4d2fcda540.zip
[Sanitizer] Pass proper values to DTLS_on_libc_memalign.
Fix a surprising typo: the old code used to think that dynamic TLS segments were several times larger than they actually are. llvm-svn: 257722
-rw-r--r--compiler-rt/lib/asan/asan_malloc_linux.cc2
-rw-r--r--compiler-rt/lib/msan/msan_interceptors.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler-rt/lib/asan/asan_malloc_linux.cc b/compiler-rt/lib/asan/asan_malloc_linux.cc
index d5089f9f7b3..a81f19ffe7f 100644
--- a/compiler-rt/lib/asan/asan_malloc_linux.cc
+++ b/compiler-rt/lib/asan/asan_malloc_linux.cc
@@ -92,7 +92,7 @@ INTERCEPTOR(void*, aligned_alloc, uptr boundary, uptr size) {
INTERCEPTOR(void*, __libc_memalign, uptr boundary, uptr size) {
GET_STACK_TRACE_MALLOC;
void *res = asan_memalign(boundary, size, &stack, FROM_MALLOC);
- DTLS_on_libc_memalign(res, size * boundary);
+ DTLS_on_libc_memalign(res, size);
return res;
}
diff --git a/compiler-rt/lib/msan/msan_interceptors.cc b/compiler-rt/lib/msan/msan_interceptors.cc
index fc28e080f26..65671eebefe 100644
--- a/compiler-rt/lib/msan/msan_interceptors.cc
+++ b/compiler-rt/lib/msan/msan_interceptors.cc
@@ -195,7 +195,7 @@ INTERCEPTOR(void *, __libc_memalign, SIZE_T boundary, SIZE_T size) {
GET_MALLOC_STACK_TRACE;
CHECK_EQ(boundary & (boundary - 1), 0);
void *ptr = MsanReallocate(&stack, nullptr, size, boundary, false);
- DTLS_on_libc_memalign(ptr, size * boundary);
+ DTLS_on_libc_memalign(ptr, size);
return ptr;
}
OpenPOWER on IntegriCloud