Poisoning applied to only class members, and before dtors for base class invoked
Details
- Reviewers
kcc eugenis - Commits
- rGe50cb9b9c8b3: Fix previous commit: poison only class members, simpler tests
rG9bd83fd465b7: Implement poisoning of only class members in dtor, as opposed to also poisoning…
rC244933: Fix previous commit: poison only class members, simpler tests
rC244819: Implement poisoning of only class members in dtor, as opposed to also poisoning…
rL244819: Implement poisoning of only class members in dtor, as opposed to also…
Diff Detail
Event Timeline
I assume this makes the XFAIL-ed test in compiler-rt pass? Then you need to remove the XFAIL either in this change, or in another, simultaneously committed change.
Please check that this does the right thing for non-trivial class members. This should be tested in compiler-rt. In any case, this seems to be a change in the right direction.
lib/CodeGen/CGClass.cpp | ||
---|---|---|
1383 | So if there are 0 fields, you poison the entire object? This does not sound right. | |
1389 | There must be a way to do this with a single GEP, without bitcasting to int8ptrty. See how clang emits member address expression, like &(a->b). | |
test/CodeGenCXX/sanitize-dtor-derived-class.cpp | ||
28 | Don't need {{.*}} at the end of the line. |
- clang tests to verify dtor sanitizing function emitted only in the last dtor of this class, and before base dtors are invoked
LGTM with a nit
lib/CodeGen/CGClass.cpp | ||
---|---|---|
1396 | No need to emit the call is PoisonSize is 0. |
- Removed patch file containing extraneous changes
- clang tests to verify dtor sanitizing function emitted only in the last dtor of this class, and before base dtors are invoked
- skip poisoning if class has no fields
So if there are 0 fields, you poison the entire object? This does not sound right.