[ASan] Behave the same for functions w/o sanitize_address attribute and blacklisted...
authorAlexey Samsonov <vonosmas@gmail.com>
Sat, 31 May 2014 00:33:05 +0000 (00:33 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Sat, 31 May 2014 00:33:05 +0000 (00:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209946 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp

index ede32fe57f7e46c5059911cf0a7af9c73ba7e2ad..9e5fca7d68d0c1f2b66f3cb281e6fa419660daca 100644 (file)
@@ -1310,7 +1310,6 @@ bool AddressSanitizer::InjectCoverage(Function &F,
 }
 
 bool AddressSanitizer::runOnFunction(Function &F) {
-  if (BL->isIn(F)) return false;
   if (&F == AsanCtorFunction) return false;
   if (F.getLinkage() == GlobalValue::AvailableExternallyLinkage) return false;
   DEBUG(dbgs() << "ASAN instrumenting:\n" << F << "\n");
@@ -1319,7 +1318,7 @@ bool AddressSanitizer::runOnFunction(Function &F) {
   // If needed, insert __asan_init before checking for SanitizeAddress attr.
   maybeInsertAsanInitAtFunctionEntry(F);
 
-  if (!F.hasFnAttribute(Attribute::SanitizeAddress))
+  if (!F.hasFnAttribute(Attribute::SanitizeAddress) || BL->isIn(F))
     return false;
 
   if (!ClDebugFunc.empty() && ClDebugFunc != F.getName())