summaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-02-25 14:40:42 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-02-25 14:40:42 +0000
commit2344cbce571b60627653ec3015125737e5f8c68d (patch)
tree978eae48e869bcf6e7f04f92efa77d9a1fd4a7b8 /lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
parent47c4f8f1661f7cab0cf1ade9824cf0f5f1762403 (diff)
Notes
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp b/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
index 15e8ea31c4c4..b47762b915ce 100644
--- a/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
@@ -179,7 +179,8 @@ void WalkAST::VisitCXXMemberCallExpr(CallExpr *CE) {
}
// Get the callee.
- const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(CE->getDirectCallee());
+ const CXXMethodDecl *MD =
+ dyn_cast_or_null<CXXMethodDecl>(CE->getDirectCallee());
if (MD && MD->isVirtual() && !callIsNonVirtual && !MD->hasAttr<FinalAttr>() &&
!MD->getParent()->hasAttr<FinalAttr>())
ReportVirtualCall(CE, MD->isPure());