[compiler-rt] r257722 - [Sanitizer] Pass proper values to DTLS_on_libc_memalign.
Alexey Samsonov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 13 16:04:37 PST 2016
Author: samsonov
Date: Wed Jan 13 18:04:37 2016
New Revision: 257722
URL: http://llvm.org/viewvc/llvm-project?rev=257722&view=rev
Log:
[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.
Modified:
compiler-rt/trunk/lib/asan/asan_malloc_linux.cc
compiler-rt/trunk/lib/msan/msan_interceptors.cc
Modified: compiler-rt/trunk/lib/asan/asan_malloc_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_malloc_linux.cc?rev=257722&r1=257721&r2=257722&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_malloc_linux.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_malloc_linux.cc Wed Jan 13 18:04:37 2016
@@ -92,7 +92,7 @@ INTERCEPTOR(void*, aligned_alloc, uptr b
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;
}
Modified: compiler-rt/trunk/lib/msan/msan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=257722&r1=257721&r2=257722&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_interceptors.cc Wed Jan 13 18:04:37 2016
@@ -195,7 +195,7 @@ INTERCEPTOR(void *, __libc_memalign, SIZ
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;
}
More information about the llvm-commits
mailing list