[PATCH] [ASan] Make BlockingMutex really linker initialized.

Yury Gribov tetra2005 at gmail.com
Thu Jan 29 01:28:33 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:501
@@ -504,2 +500,3 @@
 void BlockingMutex::Lock() {
+  CHECK_EQ(owner_, 0);
   atomic_uint32_t *m = reinterpret_cast<atomic_uint32_t *>(&opaque_storage_);
----------------
samsonov wrote:
> owner_ isn't used in any other BlockingMutex functions on Linux. Let's just delete this line.
Then the field would become unused causing build errors. And removing it just for Linux would cause more #ifdefs. BTW what's the reason for different treatment of owner_ on Linux and Mac? Looks like Mac check got strengthened at some point.

http://reviews.llvm.org/D7171

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list