Skip to content

Commit

Permalink
[ASan] Behave the same for functions w/o sanitize_address attribute a…
Browse files Browse the repository at this point in the history
…nd blacklisted functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209946 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
vonosmas committed May 31, 2014
1 parent 014f9fd commit 41dac4a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Transforms/Instrumentation/AddressSanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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())
Expand Down

0 comments on commit 41dac4a

Please sign in to comment.