[scudo] Don't unmap other low memory pages if mapping doesn't exist
authorDominic Chen <ddchen@apple.com>
Wed, 16 Mar 2022 20:51:08 +0000 (13:51 -0700)
committerDominic Chen <ddchen@apple.com>
Thu, 17 Mar 2022 17:17:36 +0000 (10:17 -0700)
commit4787e5c34ec8f710f545e33285b7a121eaf05e54
treef4efedec17904198de51d0140d4b406019ecbe8e
parente53641927918e1ac0281b6e57a1b2d8e3ad98bb5
[scudo] Don't unmap other low memory pages if mapping doesn't exist

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
compiler-rt/lib/scudo/standalone/primary64.h