r299191 - [msan] Turn off lifetime markers even when use after scope checking is on.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 31 02:19:26 PDT 2017


Author: d0k
Date: Fri Mar 31 04:19:25 2017
New Revision: 299191

URL: http://llvm.org/viewvc/llvm-project?rev=299191&view=rev
Log:
[msan] Turn off lifetime markers even when use after scope checking is on.

Since r299174 use after scope checking is on by default. Even though
msan doesn't check for use after scope it gets confused by the lifetime
markers emitted for it, making unit tests fail. This is covered by
ninja check-msan.

Modified:
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=299191&r1=299190&r2=299191&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Fri Mar 31 04:19:25 2017
@@ -45,15 +45,15 @@ static bool shouldEmitLifetimeMarkers(co
   if (CGOpts.DisableLifetimeMarkers)
     return false;
 
-  // Asan uses markers for use-after-scope checks.
-  if (CGOpts.SanitizeAddressUseAfterScope)
-    return true;
-
   // Disable lifetime markers in msan builds.
   // FIXME: Remove this when msan works with lifetime markers.
   if (LangOpts.Sanitize.has(SanitizerKind::Memory))
     return false;
 
+  // Asan uses markers for use-after-scope checks.
+  if (CGOpts.SanitizeAddressUseAfterScope)
+    return true;
+
   // For now, only in optimized builds.
   return CGOpts.OptimizationLevel != 0;
 }




More information about the cfe-commits mailing list