This is an archive of the discontinued LLVM Phabricator instance.

[analyzer][UninitializedObjectChecker] Void pointer objects are casted back to their dynmic type in note message
ClosedPublic

Authored by Szelethus on Jul 12 2018, 5:09 AM.

Diff Detail

Event Timeline

Szelethus created this revision.Jul 12 2018, 5:09 AM

Rebased to the latest trunk.

george.karpenkov requested changes to this revision.Jul 17 2018, 11:10 AM

Cf. my comments to https://reviews.llvm.org/D49437: while this change looks great, is it possible to separate the pointer chasing from the rest of the checker?

This revision now requires changes to proceed.Jul 17 2018, 11:10 AM
NoQ added inline comments.Jul 25 2018, 5:49 PM
test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
290

Shouldn't this rather say something like static_cast<int *>(this->vptr)? That's the normal syntax to do this sort of stuff, i guess.

whisperity added inline comments.Jul 26 2018, 2:25 AM
test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
290

Not just "normal syntax", this syntax of the output does not compile.

foo.cpp:6:13: error: expected unqualified-id
      this->static_cast<int*>(vptr) = new int();
Szelethus updated this revision to Diff 159918.Aug 9 2018, 7:04 AM

The solution now relies on the refactored version of the checker. Note that it modifies roughly 75% less code ;).

Szelethus marked 2 inline comments as done.Aug 9 2018, 10:20 AM
george.karpenkov accepted this revision.Aug 10 2018, 2:16 PM
This revision is now accepted and ready to land.Aug 10 2018, 2:16 PM
This revision was automatically updated to reflect the committed changes.