forked from OSchip/llvm-project
Add missing null check. Not sure why my tests passed before.
llvm-svn: 173292
This commit is contained in:
parent
54cd3c6811
commit
5b4500b43a
|
@ -102,10 +102,12 @@ static bool END_WITH_NULL isMultiArgSelector(const Selector *Sel, ...) {
|
|||
void NoReturnFunctionChecker::checkPostObjCMessage(const ObjCMethodCall &Msg,
|
||||
CheckerContext &C) const {
|
||||
// Check if the method is annotated with analyzer_noreturn.
|
||||
const ObjCMethodDecl *MD = Msg.getDecl()->getCanonicalDecl();
|
||||
if (MD->hasAttr<AnalyzerNoReturnAttr>()) {
|
||||
C.generateSink();
|
||||
return;
|
||||
if (const ObjCMethodDecl *MD = Msg.getDecl()) {
|
||||
MD = MD->getCanonicalDecl();
|
||||
if (MD->hasAttr<AnalyzerNoReturnAttr>()) {
|
||||
C.generateSink();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// HACK: This entire check is to handle two messages in the Cocoa frameworks:
|
||||
|
|
Loading…
Reference in New Issue