In VirtualCallChecker, handle indirect calls.
getDirectCallee() can be nullptr, and dyn_cast(nullptr) is UB
 Differential  D29303  
In VirtualCallChecker, handle indirect calls Authored by sammccall on Jan 30 2017, 1:15 PM. 
Details 
 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 :\ Comment Actions Has this been cherry-picked into the clang 4.0 release branch? If not, we should definitely do that!  |