Tests can register multiple allocators, but only the first will initialize since it initializes the TSDRegistrySharedT. Then, destruction of subsequent allocator may end up unmapping a nullptr PrimaryBase with non-zero PrimarySize.
Differential Revision: https://reviews.llvm.org/D121858
RegionInfo *Region = getRegionInfo(I);
*Region = {};
}
- unmap(reinterpret_cast<void *>(PrimaryBase), PrimarySize, UNMAP_ALL, &Data);
+ if (PrimaryBase)
+ unmap(reinterpret_cast<void *>(PrimaryBase), PrimarySize, UNMAP_ALL,
+ &Data);
PrimaryBase = 0U;
}