[compiler-rt] r351689 - Fix bug in `AsanAllocatorASVT` (ASan) and `AllocatorASVT` (LSan) templated alias.

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 20 08:57:24 PST 2019


Author: delcypher
Date: Sun Jan 20 08:57:24 2019
New Revision: 351689

URL: http://llvm.org/viewvc/llvm-project?rev=351689&view=rev
Log:
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

Modified:
    compiler-rt/trunk/lib/asan/asan_allocator.h
    compiler-rt/trunk/lib/lsan/lsan_allocator.h

Modified: compiler-rt/trunk/lib/asan/asan_allocator.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator.h?rev=351689&r1=351688&r2=351689&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_allocator.h (original)
+++ compiler-rt/trunk/lib/asan/asan_allocator.h Sun Jan 20 08:57:24 2019
@@ -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 {

Modified: compiler-rt/trunk/lib/lsan/lsan_allocator.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_allocator.h?rev=351689&r1=351688&r2=351689&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_allocator.h (original)
+++ compiler-rt/trunk/lib/lsan/lsan_allocator.h Sun Jan 20 08:57:24 2019
@@ -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();




More information about the llvm-commits mailing list