forked from qt-creator/qt-creator
CPlusPlus: Fix parser crash
The parseCompoundStatement() function can return without setting the output parameter if the maximum statement depth is exceeded. Task-number: QTCREATORBUG-29847 Change-Id: Ifd76cd948c30498863246a1b80bd0657950101ca Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
2
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
2
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
@@ -4946,7 +4946,7 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
|
||||
CompoundExpressionAST *ast = new (_pool) CompoundExpressionAST;
|
||||
ast->lparen_token = consumeToken();
|
||||
StatementAST *statement = nullptr;
|
||||
parseCompoundStatement(statement);
|
||||
if (parseCompoundStatement(statement))
|
||||
ast->statement = statement->asCompoundStatement();
|
||||
match(T_RPAREN, &ast->rparen_token);
|
||||
node = ast;
|
||||
|
Reference in New Issue
Block a user