This is an archive of the discontinued LLVM Phabricator instance.

use-after-dtor cmd option
AbandonedPublic

Authored by nmusgrave on Jul 10 2015, 1:19 PM.

Details

Reviewers
kcc
eugenis
Summary

Initial commit: added new command line option for use-after-delete.

added in driver support for cmd-line use-after-dtor option

added in simple test case for use-after-dtor cmd line option

updated test, removed unnecessary block from code gen

adjusted test to fail unused cmd notification, updated setting flag

added linter

use-after-dtor cmd option

Initial commit: added new command line option for use-after-dtor.

inserting v basic instrumentation

updating linter

Diff Detail

Event Timeline

nmusgrave updated this revision to Diff 29483.Jul 10 2015, 1:19 PM
nmusgrave retitled this revision from to use-after-dtor cmd option.
nmusgrave updated this object.
nmusgrave added reviewers: eugenis, kcc.
nmusgrave added subscribers: llvm-commits, cfe-commits.

Couple of nits I noticed when looking.

-eric

.arclint
1–8

Probably don't want this.

include/clang/Driver/Options.td
561–563

clang-format? also inverse option?

lib/CodeGen/CGClass.cpp
1459

Comments are complete sentences.

nmusgrave abandoned this revision.Jul 10 2015, 1:34 PM

This revision contains previously submitted changes, from r241935

majnemer added inline comments.
lib/CodeGen/CGClass.cpp
1461–1462

Args and ArgTypes always have a fixed number of elements. An array might be a better choice.

1468–1476

I couldn't find a definition of __sanitizer_dtor_exit_callback but int seems like the wrong type if it is supposed to hold the size of the record.

Consider:

struct S { char x[1ULL << 32]; ~S() {} } s;

This type will have size 4294967296 but will be represent as 0 if coerced to an int type on most (all?) 64-bit platforms.

eugenis added inline comments.Jul 10 2015, 2:43 PM
lib/CodeGen/CGClass.cpp
1468–1476

__sanitizer_dtor_exit_callback is not implemented yet.
Yes, it should accept (void *, size_t).

nmusgrave marked an inline comment as done.Jul 17 2015, 4:51 PM
nmusgrave added inline comments.
include/clang/Driver/Options.td
561–563

as in an option to explicitly turn off this type of checking...?

lib/CodeGen/CGClass.cpp
1459

resolved in d11109

1468–1476

revision here contains updated types