This is an archive of the discontinued LLVM Phabricator instance.

Dtor callback emitted when msan attribute not repressed for this function.
ClosedPublic

Authored by nmusgrave on Aug 3 2015, 11:59 AM.

Details

Summary

In addition to checking compiler flags, the front-end also examines the attributes of the destructor definition to ensure that the SanitizeMemory attribute is attached.

Diff Detail

Event Timeline

nmusgrave updated this revision to Diff 31250.Aug 3 2015, 11:59 AM
nmusgrave retitled this revision from to Dtor callback emitted when msan attribute not repressed for this function..
nmusgrave updated this object.
nmusgrave added reviewers: eugenis, kcc.
nmusgrave added a subscriber: cfe-commits.
eugenis edited edge metadata.Aug 3 2015, 1:26 PM

What happens if the attribute is used with the "= default" destructor?

lib/CodeGen/CGClass.cpp
1483

I think it would be cleaner to use CodegenFunction::SanOpts

test/CodeGenCXX/sanitize-dtor-callback.cpp
22 ↗(On Diff #31250)

Maybe move this to a separate test file? This one gets cluttered; for example, tail call is a completely orthogonal issue and attribute test should not have to deal with it.

25 ↗(On Diff #31250)

Remove {{^ }} to make the check stronger.

nmusgrave updated this revision to Diff 31263.Aug 3 2015, 1:44 PM
nmusgrave edited edge metadata.
  • refactored test into new file, revised how function attribute examined
nmusgrave marked 2 inline comments as done.Aug 3 2015, 1:44 PM
nmusgrave marked an inline comment as done.Aug 3 2015, 1:45 PM
eugenis added inline comments.Aug 3 2015, 1:46 PM
test/CodeGenCXX/sanitize-dtor-callback.cpp
72 ↗(On Diff #31263)

extra lines?

nmusgrave updated this revision to Diff 31276.Aug 3 2015, 3:35 PM
  • modified test to examine default dtor with and without attribute
eugenis accepted this revision.Aug 3 2015, 3:44 PM
eugenis edited edge metadata.

LGTM, but please remove the extra lines in sanitize-dtor-callback.cpp.

This revision is now accepted and ready to land.Aug 3 2015, 3:44 PM
nmusgrave updated this revision to Diff 31282.Aug 3 2015, 3:45 PM
nmusgrave edited edge metadata.
  • removed attribute check
nmusgrave closed this revision.Aug 3 2015, 3:56 PM