Bug 895845 - Temporary ASan workaround in NS_IsMainThread. r=mccr8
authorChristian Holler <choller@mozilla.com>
Sat, 27 Jul 2013 01:37:19 +0200
changeset 140250 48d3d69fd9b103b5a6f12680492c32e9b9858bed
parent 140249 2fd67ab03768efd84974ef483a1ac85c434d5eec
child 140251 c456780d7d1f7c4f6e4cf927b44a98305d8006b5
push id1951
push userryanvm@gmail.com
push dateSun, 28 Jul 2013 01:55:51 +0000
treeherderfx-team@73b69c146ca6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs895845
milestone25.0a1
Bug 895845 - Temporary ASan workaround in NS_IsMainThread. r=mccr8
xpcom/glue/nsCycleCollectorUtils.h
xpcom/glue/nsThreadUtils.h
--- a/xpcom/glue/nsCycleCollectorUtils.h
+++ b/xpcom/glue/nsCycleCollectorUtils.h
@@ -9,17 +9,23 @@
 #include "mozilla/threads/nsThreadIDs.h"
 
 #if defined(MOZILLA_INTERNAL_API)
 #if defined(XP_WIN)
 bool NS_IsCycleCollectorThread();
 #elif defined(NS_TLS)
 // Defined in nsThreadManager.cpp.
 extern NS_TLS mozilla::threads::ID gTLSThreadID;
-inline bool NS_IsCycleCollectorThread()
+#ifdef MOZ_ASAN
+// Temporary workaround, see bug 895845
+MOZ_ASAN_BLACKLIST static
+#else
+inline
+#endif
+bool NS_IsCycleCollectorThread()
 {
   return gTLSThreadID == mozilla::threads::CycleCollector;
 }
 #else
 NS_COM_GLUE bool NS_IsCycleCollectorThread();
 #endif
 #else
 NS_COM_GLUE bool NS_IsCycleCollectorThread();
--- a/xpcom/glue/nsThreadUtils.h
+++ b/xpcom/glue/nsThreadUtils.h
@@ -94,17 +94,23 @@ extern NS_COM_GLUE NS_METHOD
 NS_GetMainThread(nsIThread **result);
 
 #if defined(MOZILLA_INTERNAL_API) && defined(XP_WIN)
 bool NS_IsMainThread();
 #elif defined(MOZILLA_INTERNAL_API) && defined(NS_TLS)
 // This is defined in nsThreadManager.cpp and initialized to `Main` for the
 // main thread by nsThreadManager::Init.
 extern NS_TLS mozilla::threads::ID gTLSThreadID;
-inline bool NS_IsMainThread()
+#ifdef MOZ_ASAN
+// Temporary workaround, see bug 895845
+MOZ_ASAN_BLACKLIST static
+#else
+inline
+#endif
+bool NS_IsMainThread()
 {
   return gTLSThreadID == mozilla::threads::Main;
 }
 #else
 /**
  * Test to see if the current thread is the main thread.
  *
  * @returns true if the current thread is the main thread, and false