[PATCH] D12335: Repress sanitization on User dtor.
Naomi Musgrave via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 25 15:00:17 PDT 2015
nmusgrave updated this revision to Diff 33133.
nmusgrave added a comment.
- Combined msan macros for simplicity.
http://reviews.llvm.org/D12335
Files:
include/llvm/IR/User.h
include/llvm/Support/Compiler.h
Index: include/llvm/Support/Compiler.h
===================================================================
--- include/llvm/Support/Compiler.h
+++ include/llvm/Support/Compiler.h
@@ -318,15 +318,17 @@
# define LLVM_FUNCTION_NAME __func__
#endif
-/// \macro LLVM_MEMORY_SANITIZER_BUILD
+/// \macro LLVM_NO_SANITIZE_MEMORY_BUILD
/// \brief Whether LLVM itself is built with MemorySanitizer instrumentation.
#if __has_feature(memory_sanitizer)
-# define LLVM_MEMORY_SANITIZER_BUILD 1
+# define LLVM_NO_SANITIZE_MEMORY_BUILD 1
# include <sanitizer/msan_interface.h>
+# define NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory))
#else
-# define LLVM_MEMORY_SANITIZER_BUILD 0
+# define LLVM_NO_SANITIZE_MEMORY_BUILD 0
# define __msan_allocated_memory(p, size)
# define __msan_unpoison(p, size)
+# define NO_SANITIZE_MEMORY
#endif
/// \macro LLVM_ADDRESS_SANITIZER_BUILD
Index: include/llvm/IR/User.h
===================================================================
--- include/llvm/IR/User.h
+++ include/llvm/IR/User.h
@@ -72,8 +72,9 @@
void growHungoffUses(unsigned N, bool IsPhi = false);
public:
- ~User() override {
- }
+ // Repress memory sanitization, due to use-after-destroy by operator
+ // delete. Bug report 24578 identifies this issue.
+ NO_SANITIZE_MEMORY ~User() override {}
/// \brief Free memory allocated for User and Use objects.
void operator delete(void *Usr);
/// \brief Placement delete - required by std, but never called.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12335.33133.patch
Type: text/x-patch
Size: 1480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150825/2f5a7e70/attachment.bin>
More information about the llvm-commits
mailing list