[compiler-rt] 561b944 - sanitizer_common: Fix the build for platforms that use shared TSDs

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 12 08:50:05 PDT 2021


Author: Benjamin Kramer
Date: 2021-07-12T17:49:48+02:00
New Revision: 561b9446d69e12bb5cea263c7aa080009fc21469

URL: https://github.com/llvm/llvm-project/commit/561b9446d69e12bb5cea263c7aa080009fc21469
DIFF: https://github.com/llvm/llvm-project/commit/561b9446d69e12bb5cea263c7aa080009fc21469.diff

LOG: sanitizer_common: Fix the build for platforms that use shared TSDs

Looks like an oversight in 0da172b1766e1559ef677aa836dce4f1995dfef3

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())
           ^

Added: 
    

Modified: 
    compiler-rt/lib/scudo/scudo_tsd_shared.inc

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/scudo_tsd_shared.inc b/compiler-rt/lib/scudo/scudo_tsd_shared.inc
index 8f3362dd3d71..e46b044a81f8 100644
--- a/compiler-rt/lib/scudo/scudo_tsd_shared.inc
+++ b/compiler-rt/lib/scudo/scudo_tsd_shared.inc
@@ -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;


        


More information about the llvm-commits mailing list