In VirtualCallChecker, handle indirect calls.
getDirectCallee() can be nullptr, and dyn_cast(nullptr) is UB
Paths
| Differential D29303
In VirtualCallChecker, handle indirect calls ClosedPublic Authored by sammccall on Jan 30 2017, 1:15 PM.
Details
Summary In VirtualCallChecker, handle indirect calls. getDirectCallee() can be nullptr, and dyn_cast(nullptr) is UB
Diff Detail
Event TimelineComment Actions 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 :\ This revision is now accepted and ready to land.Jan 30 2017, 2:17 PM Closed by commit rL293604: In VirtualCallChecker, handle indirect calls (authored by sammccall). · Explain WhyJan 30 2017, 9:34 PM This revision was automatically updated to reflect the committed changes. Comment Actions Has this been cherry-picked into the clang 4.0 release branch? If not, we should definitely do that!
Revision Contents
Diff 86335 lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
|