Repress sanitization on User dtor. Modify msan macros for applying attribute
to repress sanitization. Move attribute for repressing sanitization to
operator delete for User, MDNode.
Summary: In response to bug 24578, reported against failing LLVM test.
Reviewers: chandlerc, rsmith, eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D12335
llvm-svn: 246449
diff --git a/llvm/lib/IR/User.cpp b/llvm/lib/IR/User.cpp
index 522722d..b64580c 100644
--- a/llvm/lib/IR/User.cpp
+++ b/llvm/lib/IR/User.cpp
@@ -118,7 +118,9 @@
// User operator delete Implementation
//===----------------------------------------------------------------------===//
-void User::operator delete(void *Usr) {
+// Repress memory sanitization, due to use-after-destroy by operator
+// delete. Bug report 24578 identifies this issue.
+LLVM_NO_SANITIZE_MEMORY_ATTRIBUTE void User::operator delete(void *Usr) {
// Hung off uses use a single Use* before the User, while other subclasses
// use a Use[] allocated prior to the user.
User *Obj = static_cast<User *>(Usr);