[asan] enable asan only for the functions that have Attribute::AddressSafety

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148846 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kostya Serebryany
2012-01-24 19:34:43 +00:00
parent 88a54de799
commit 0307b9a885
4 changed files with 5 additions and 4 deletions

View File

@@ -608,6 +608,7 @@ bool AddressSanitizer::runOnModule(Module &M) {
bool AddressSanitizer::handleFunction(Module &M, Function &F) {
if (BL->isIn(F)) return false;
if (&F == AsanCtorFunction) return false;
if (!F.hasFnAttr(Attribute::AddressSafety)) return false;
if (!ClDebugFunc.empty() && ClDebugFunc != F.getName())
return false;