summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Liew <dan@su-root.co.uk>2019-01-20 16:57:24 +0000
committerDan Liew <dan@su-root.co.uk>2019-01-20 16:57:24 +0000
commitb5b9a27a9a608336d201ca73761f838881b68bcd (patch)
tree68b6bc9285280b550af5f7adfd570fe94da4ddf7
parent7a739a0dfb6d408c6d587e5c7b52abd89fc3fdd3 (diff)
downloadcompiler-rt-b5b9a27a9a608336d201ca73761f838881b68bcd.tar.gz
Fix bug in `AsanAllocatorASVT` (ASan) and `AllocatorASVT` (LSan) templated alias.
We forgot to pass `AddressSpaceView` to the `CombinedAllocator` which meant we would always use `LocalAddressSpaceView` for the `CombinedAllocator` leading to a static_assert failing when we tried to do `AsanAllocatorASVT<RemoteAddressSpaceView>` or `AllocatorASVT<RemoteAddressSpaceView>`. rdar://problem/45284065 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351689 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/asan/asan_allocator.h3
-rw-r--r--lib/lsan/lsan_allocator.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/asan/asan_allocator.h b/lib/asan/asan_allocator.h
index 339c6df01..c8987ac9e 100644
--- a/lib/asan/asan_allocator.h
+++ b/lib/asan/asan_allocator.h
@@ -204,7 +204,8 @@ template <typename AddressSpaceView>
using AsanAllocatorASVT =
CombinedAllocator<PrimaryAllocatorASVT<AddressSpaceView>,
AllocatorCacheASVT<AddressSpaceView>,
- SecondaryAllocatorASVT<AddressSpaceView>>;
+ SecondaryAllocatorASVT<AddressSpaceView>,
+ AddressSpaceView>;
using AsanAllocator = AsanAllocatorASVT<LocalAddressSpaceView>;
struct AsanThreadLocalMallocStorage {
diff --git a/lib/lsan/lsan_allocator.h b/lib/lsan/lsan_allocator.h
index 2007b1e4e..2d6b21a03 100644
--- a/lib/lsan/lsan_allocator.h
+++ b/lib/lsan/lsan_allocator.h
@@ -110,7 +110,8 @@ template <typename AddressSpaceView>
using AllocatorASVT =
CombinedAllocator<PrimaryAllocatorASVT<AddressSpaceView>,
AllocatorCacheASVT<AddressSpaceView>,
- SecondaryAllocatorASVT<AddressSpaceView>>;
+ SecondaryAllocatorASVT<AddressSpaceView>,
+ AddressSpaceView>;
using Allocator = AllocatorASVT<LocalAddressSpaceView>;
AllocatorCache *GetAllocatorCache();