forked from qt-creator/qt-creator
AutoTest: Avoid possible nullptr access
Fixes a crash when loading qtdeclarative and parsing for Qt Quick tests. Fixes: QTCREATORBUG-23864 Change-Id: I0c88908f578e2dd92341a6fdd427aed5157bb94b Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Richard Weickelt <richard@weickelt.de>
This commit is contained in:
@@ -212,6 +212,8 @@ bool QuickTestAstVisitor::visit(CPlusPlus::CallAST *ast)
|
|||||||
|
|
||||||
if (expressionListAST && expressionListAST->value) {
|
if (expressionListAST && expressionListAST->value) {
|
||||||
const auto *stringLitAST = expressionListAST->value->asStringLiteral();
|
const auto *stringLitAST = expressionListAST->value->asStringLiteral();
|
||||||
|
if (!stringLitAST)
|
||||||
|
return false;
|
||||||
const auto *string
|
const auto *string
|
||||||
= translationUnit()->stringLiteral(stringLitAST->literal_token);
|
= translationUnit()->stringLiteral(stringLitAST->literal_token);
|
||||||
if (string) {
|
if (string) {
|
||||||
|
Reference in New Issue
Block a user