scudo: Call setCurrentTSD(nullptr) when bringing down the TSD registry in tests.
authorPeter Collingbourne <peter@pcc.me.uk>
Wed, 27 Nov 2019 03:17:10 +0000 (19:17 -0800)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 27 Nov 2019 17:55:14 +0000 (09:55 -0800)
commitf30fe16d4902617a33dac1ebca066a7cb7e0f2ec
treed45c14860cf2f39c5b3ce920629e050a47e50a54
parent2045d2c90e240bf618d4e10f78f38dedc6db9357
scudo: Call setCurrentTSD(nullptr) when bringing down the TSD registry in tests.

Otherwise, we will hit a use-after-free when testing multiple instances of
the same allocator on the same thread. This only recently became a problem
with D70552 which caused us to run both ScudoCombinedTest.BasicCombined and
ScudoCombinedTest.ReleaseToOS on the unit tests' main thread.

Differential Revision: https://reviews.llvm.org/D70760
compiler-rt/lib/scudo/standalone/tsd_shared.h