summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/cppunitassertequals.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/compilerplugins/clang/cppunitassertequals.cxx b/compilerplugins/clang/cppunitassertequals.cxx
index 907f203d2917..f5db38421dd3 100644
--- a/compilerplugins/clang/cppunitassertequals.cxx
+++ b/compilerplugins/clang/cppunitassertequals.cxx
@@ -76,19 +76,19 @@ void CppunitAssertEquals::checkExpr(const Stmt* stmt)
return;
}
parent = parentStmt(parent);
- if (!isa<UnaryOperator>(parent)) {
+ if (!parent || !isa<UnaryOperator>(parent)) {
return;
}
parent = parentStmt(parent);
- if (!isa<CallExpr>(parent)) {
+ if (!parent || !isa<CallExpr>(parent)) {
return;
}
const CallExpr* callExpr = dyn_cast<CallExpr>(parent);
- if (callExpr->getDirectCallee() == nullptr) {
+ if (!callExpr || callExpr->getDirectCallee() == nullptr) {
return;
}
const FunctionDecl* functionDecl = callExpr->getDirectCallee()->getCanonicalDecl();
- if (functionDecl->getQualifiedNameAsString().find("Asserter::failIf") == std::string::npos) {
+ if (!functionDecl || functionDecl->getQualifiedNameAsString().find("Asserter::failIf") == std::string::npos) {
return;
}
report(