This is an archive of the discontinued LLVM Phabricator instance.

Runtime check of poisoning derived class members.
ClosedPublic

Authored by nmusgrave on Aug 3 2015, 1:25 PM.

Details

Summary

Simple test case to verify that an instance of a derived class with virtual base is properly poisoned

Diff Detail

Event Timeline

nmusgrave updated this revision to Diff 31257.Aug 3 2015, 1:25 PM
nmusgrave retitled this revision from to Runtime check of poisoning derived class members..
nmusgrave updated this object.
nmusgrave added reviewers: eugenis, kcc.
nmusgrave added a subscriber: cfe-commits.
eugenis added inline comments.Aug 3 2015, 1:39 PM
test/msan/dtor-derived-class.cc
12

missing space

31

Allocate this with new(), otherwise you get undefined behavior at exit.

34

This can be re-phrased as assert(__msan_test_shadow(...) != -1).
No printfs, no checks. Don't even need FIleCheck.

35

An object may contain padding that does not have to be initialized. It's better to check user-visible things, like B::x_ and D::y_;

49

Do you check that the local pointer to b is not poisoned? It's true, of course, why would it be?

nmusgrave updated this revision to Diff 31281.Aug 3 2015, 3:43 PM
nmusgrave marked 3 inline comments as done.
  • modified test to be more concise, and check the local pointer to the destroyed object
eugenis accepted this revision.Aug 3 2015, 3:51 PM
eugenis edited edge metadata.

LGTM

test/msan/dtor-derived-class.cc
35

Please remove this check, and the same check for "b".

This revision is now accepted and ready to land.Aug 3 2015, 3:51 PM
nmusgrave updated this revision to Diff 31283.Aug 3 2015, 4:00 PM
nmusgrave edited edge metadata.
  • revised test to not examine padding- only explicit object members
nmusgrave closed this revision.Aug 3 2015, 4:02 PM