[PATCH] D12713: Explicit reference to issue.

Naomi Musgrave via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 09:28:15 PDT 2015


nmusgrave updated this revision to Diff 34347.
nmusgrave marked 3 inline comments as done.
nmusgrave added a comment.

- Clean test case & comments.


http://reviews.llvm.org/D12713

Files:
  test/msan/dtor-trivial.cpp
  test/msan/dtor-vtable.cc

Index: test/msan/dtor-vtable.cc
===================================================================
--- /dev/null
+++ test/msan/dtor-vtable.cc
@@ -0,0 +1,26 @@
+// RUN: %clangxx_msan %s -O0 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t
+
+// RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t
+
+// RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t
+
+// Expected to quit due to invalid access when invoking
+// function using vtable.
+// XFAIL: *
+
+#include <sanitizer/msan_interface.h>
+
+class A {
+public:
+  int x;
+  ~A() {}
+  virtual void A_Foo() {}
+};
+
+int main() {
+  A *a = new A();
+  a->~A();
+  // Shouldn't be allowed to invoke function via vtable.
+  a->A_Foo();
+  return 0;
+}
Index: test/msan/dtor-trivial.cpp
===================================================================
--- test/msan/dtor-trivial.cpp
+++ test/msan/dtor-trivial.cpp
@@ -4,7 +4,9 @@
 
 // RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1
 
-// TODO Success pending on resolution of 596
+// TODO Success pending on resolution of
+// https://github.com/google/sanitizers/issues/596
+
 // XFAIL: *
 
 #include <assert.h>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12713.34347.patch
Type: text/x-patch
Size: 1401 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150909/6b61a847/attachment.bin>


More information about the llvm-commits mailing list