This is an archive of the discontinued LLVM Phabricator instance.

In VirtualCallChecker, handle indirect calls
ClosedPublic

Authored by sammccall on Jan 30 2017, 1:15 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

sammccall updated this revision to Diff 86337.Jan 30 2017, 1:15 PM
sammccall created this revision.

Oops, reverted noise :(

I couldn't work out how to add a test for this, advice appreciated.

Closest I could get was adding something like this to test/Analysis/virtualcall.cpp:

class F { public: F(); void foo(); };
F::F() { void (F::* ptr) = &F::foo; (this->*ptr)(); }

which crashes, but only if I add extra logging :\

bkramer edited edge metadata.Jan 30 2017, 1:40 PM

Your test case is fine, it crashes with assertions enabled.

sammccall updated this revision to Diff 86342.Jan 30 2017, 1:59 PM

Add regression test.

This revision is now accepted and ready to land.Jan 30 2017, 2:17 PM
This revision was automatically updated to reflect the committed changes.

Has this been cherry-picked into the clang 4.0 release branch? If not, we should definitely do that!