Poisoning applied to only class members, and before dtors for base class invoked
Details
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
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
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 ↗ | (On Diff #31836) | So if there are 0 fields, you poison the entire object? This does not sound right. |
1389 ↗ | (On Diff #31836) | 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 ↗ | (On Diff #31836) | Don't need {{.*}} at the end of the line. |
Comment Actions
- clang tests to verify dtor sanitizing function emitted only in the last dtor of this class, and before base dtors are invoked
Comment Actions
LGTM with a nit
lib/CodeGen/CGClass.cpp | ||
---|---|---|
1396 ↗ | (On Diff #31978) | No need to emit the call is PoisonSize is 0. |
Comment Actions
- 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