[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
This commit is contained in:
Alexey Samsonov 2016-01-14 00:04:37 +00:00
parent 9de6d7becc
commit 38b3130c7a
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}