eugenis added inline comments.

================
Comment at: test/msan/dtor-member.cc:9
@@ +8,3 @@
+// RUN: FileCheck %s < %t.out
+
+#include <sanitizer/msan_interface.h>
----------------
Please add run lines without (a) compiler flag and (b) runtime flag.

================
Comment at: test/msan/dtor-member.cc:22
@@ +21,3 @@
+  Simple s(5);
+  s.~Simple();
+  __msan_check_mem_is_initialized(&s, sizeof(s));
----------------
If we don't crash on the next line (in the negative test), there will be a 
second destructor call at the function exit, which invokes undefined behavior. 
Let's change the code to smth like this:

unsigned long buf[1];
assert(sizeof(Simple) <= sizeof(buf));
Simple *s = new(&buf) Simple();
s->~Simple();



http://reviews.llvm.org/D11283




_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to