[compiler-rt] r270044 - Revert r270038 ("Change preprocessor `#if` to regular `if` for CAN_SANITIZE_LEAKS")

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 04:21:37 PDT 2016


Author: kuba.brecka
Date: Thu May 19 06:21:34 2016
New Revision: 270044

URL: http://llvm.org/viewvc/llvm-project?rev=270044&view=rev
Log:
Revert r270038 ("Change preprocessor `#if` to regular `if` for CAN_SANITIZE_LEAKS")


Modified:
    compiler-rt/trunk/lib/asan/asan_rtl.cc

Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=270044&r1=270043&r2=270044&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Thu May 19 06:21:34 2016
@@ -540,12 +540,12 @@ static void AsanInitInternal() {
   force_interface_symbols();  // no-op.
   SanitizerInitializeUnwinder();
 
-  if (CAN_SANITIZE_LEAKS) {
-    __lsan::InitCommonLsan();
-    if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit) {
-      Atexit(__lsan::DoLeakCheck);
-    }
+#if CAN_SANITIZE_LEAKS
+  __lsan::InitCommonLsan();
+  if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit) {
+    Atexit(__lsan::DoLeakCheck);
   }
+#endif  // CAN_SANITIZE_LEAKS
 
 #if CAN_SANITIZE_UB
   __ubsan::InitAsPlugin();
@@ -553,12 +553,12 @@ static void AsanInitInternal() {
 
   InitializeSuppressions();
 
-  if (CAN_SANITIZE_LEAKS) {
+  {
+#if CAN_SANITIZE_LEAKS
     // LateInitialize() calls dlsym, which can allocate an error string buffer
     // in the TLS.  Let's ignore the allocation to avoid reporting a leak.
     __lsan::ScopedInterceptorDisabler disabler;
-    Symbolizer::LateInitialize();
-  } else {
+#endif
     Symbolizer::LateInitialize();
   }
 




More information about the llvm-commits mailing list