A virtual base class and derived class should only poison their
respective members upon destruction. In particular, trivial members should
be poisoned directly, non-trivial members should be poisoned by their
respective destructors, and references to non-trivial members should be
poisoned.
Details
Diff Detail
Event Timeline
test/msan/dtor-base-access.cc | ||
---|---|---|
6 | I think this is usually expressed with XFAIL: on a separate line to show that this is not a desired behavior. The test will show up on the "expected failures" line then, and not as a "passing" test. | |
33 | I don't like this cast. Please change B to accept the address of y as a constructor argument. | |
44 | Heap allocation to avoid undefined behavior. |
test/msan/dtor-base-access.cc | ||
---|---|---|
6 | Wait, does this expect a compilation failure? |
Don't call Base "a virtual base class" - it's not. It only has a virtual destructor, which is btw not used in this test and can be omitted.
test/msan/dtor-base-access.cc | ||
---|---|---|
2 | -Xclang -disable-llvm-optzns is used to suppress all LLVM optimization passes when the test needs to examine LLVM IR immediately after the frontend. It should not be used in the end-to-end tests in compiler-rt. | |
18 | That's not a reference, that's a value. |
test/msan/dtor-base-access.cc | ||
---|---|---|
53 | Not clear what this (and the following assert) does. Maybe replace them with a check for d->x_ptr, which should be good here and poisoned after the destructor? |
test/msan/dtor-base-access.cc | ||
---|---|---|
53 | Hm, I think you want to check that x_ptr itself is poisoned/unpoisoned. |
-Xclang -disable-llvm-optzns is used to suppress all LLVM optimization passes when the test needs to examine LLVM IR immediately after the frontend. It should not be used in the end-to-end tests in compiler-rt.