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>
This commit is contained in:
parent
42032f5d3b
commit
a3d8833bd8
@ -76,19 +76,19 @@ void CppunitAssertEquals::checkExpr(const Stmt* stmt)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
parent = parentStmt(parent);
|
parent = parentStmt(parent);
|
||||||
if (!isa<UnaryOperator>(parent)) {
|
if (!parent || !isa<UnaryOperator>(parent)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
parent = parentStmt(parent);
|
parent = parentStmt(parent);
|
||||||
if (!isa<CallExpr>(parent)) {
|
if (!parent || !isa<CallExpr>(parent)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const CallExpr* callExpr = dyn_cast<CallExpr>(parent);
|
const CallExpr* callExpr = dyn_cast<CallExpr>(parent);
|
||||||
if (callExpr->getDirectCallee() == nullptr) {
|
if (!callExpr || callExpr->getDirectCallee() == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const FunctionDecl* functionDecl = callExpr->getDirectCallee()->getCanonicalDecl();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
report(
|
report(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user