summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-03-05 05:31:04 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-03-05 11:44:27 +0000
commita3d8833bd8392ee274ced8d5b1a6e91f9b17deff (patch)
tree776f92afabde2d1e0ba0e290bf58346d3c1db851 /compilerplugins
parent42032f5d3b960185a9e4b1b63680af0ae27dca2d (diff)
fix crash in cppunitassertequals plugin
Change-Id: I0427c70aa3a7f55aba4bbe0fe571aab08596541a Reviewed-on: https://gerrit.libreoffice.org/22922 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
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(