summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorNaomi Musgrave <nmusgrave@google.com>2015-08-03 22:53:11 +0000
committerNaomi Musgrave <nmusgrave@google.com>2015-08-03 22:53:11 +0000
commitbb4df94faa8cb027fb76d17ff7145f98700bac0a (patch)
treea32021f81a6b93eea218067410b1231139b2778b /clang/lib/CodeGen
parent45291391b281283ac36ed7415cfaee54db4e2e17 (diff)
downloadbcm5719-llvm-bb4df94faa8cb027fb76d17ff7145f98700bac0a.tar.gz
bcm5719-llvm-bb4df94faa8cb027fb76d17ff7145f98700bac0a.zip
Dtor callback emitted when msan attribute not repressed for this function.
Summary: In addition to checking compiler flags, the front-end also examines the attributes of the destructor definition to ensure that the SanitizeMemory attribute is attached. Reviewers: eugenis, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11727 refactored test into new file, revised how function attribute examined modified test to examine default dtor with and without attribute removed attribute check llvm-svn: 243912
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGClass.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp
index 0426f6992a2..740cd4ab4eb 100644
--- a/clang/lib/CodeGen/CGClass.cpp
+++ b/clang/lib/CodeGen/CGClass.cpp
@@ -1479,7 +1479,8 @@ void CodeGenFunction::EmitDestructorBody(FunctionArgList &Args) {
ExitCXXTryStmt(*cast<CXXTryStmt>(Body), true);
// Insert memory-poisoning instrumentation.
- if (CGM.getCodeGenOpts().SanitizeMemoryUseAfterDtor)
+ if (CGM.getCodeGenOpts().SanitizeMemoryUseAfterDtor
+ && SanOpts.has(SanitizerKind::Memory))
EmitDtorSanitizerCallback(*this, Dtor);
}
OpenPOWER on IntegriCloud