[PATCH] D12023: Test triangle inheritance member poisoning

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 11:33:39 PDT 2015


eugenis added inline comments.

================
Comment at: test/msan/dtor-bit-fields.cc:48
@@ +47,3 @@
+  Packed p;
+  p.~Packed();
+  for (int i = 0; i < 4; i++)
----------------
nmusgrave wrote:
> eugenis wrote:
> > UB, a destructor is called twice.
> > 
> I know the destructor is invoked here and when main exits, but how is that undefined behavior?
The second destructor call qualifies as access after the end of the object lifetime, I think. That's exactly what we are trying to detect here; in this simple case the destructor does not actually read the object memory, so we do not catch the problem.



http://reviews.llvm.org/D12023





More information about the llvm-commits mailing list