]> granicus.if.org Git - clang/commitdiff
[msan] Turn off lifetime markers even when use after scope checking is on.
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 31 Mar 2017 09:19:25 +0000 (09:19 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 31 Mar 2017 09:19:25 +0000 (09:19 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299191 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenFunction.cpp

index 79c0694f90285546f7877635e751dd1dd100a215..d1c068eda9a80388f8ee1a45f658c3fbef5d2501 100644 (file)
@@ -45,15 +45,15 @@ static bool shouldEmitLifetimeMarkers(const CodeGenOptions &CGOpts,
   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;
 }