sanitizer_common: Fix the build for platforms that use shared TSDs

Looks like an oversight in 0da172b176

compiler-rt/lib/scudo/scudo_tsd_shared.inc:53:1: error: mutex 'TSD->Mutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
}
^
compiler-rt/lib/scudo/scudo_tsd_shared.inc:49:12: note: mutex acquired here
  if (TSD->tryLock())
           ^
This commit is contained in:
Benjamin Kramer 2021-07-12 17:47:46 +02:00
parent f74bb95bbe
commit 561b9446d6
1 changed files with 2 additions and 1 deletions

View File

@ -41,7 +41,8 @@ ALWAYS_INLINE void initThreadMaybe(bool MinimalInit = false) {
ScudoTSD *getTSDAndLockSlow(ScudoTSD *TSD);
ALWAYS_INLINE ScudoTSD *getTSDAndLock(bool *UnlockRequired) {
ALWAYS_INLINE ScudoTSD *
getTSDAndLock(bool *UnlockRequired) NO_THREAD_SAFETY_ANALYSIS {
ScudoTSD *TSD = getCurrentTSD();
DCHECK(TSD && "No TSD associated with the current thread!");
*UnlockRequired = true;