From a76293b5ffd3d9c99465b2b61ccf0e664b5ccd02 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen <erik.verbruggen@nokia.com> Date: Tue, 2 Feb 2010 12:09:32 +0100 Subject: [PATCH] Fixed unintended switch-fall-through. For @synchornized when ObjC is disabled. --- src/shared/cplusplus/Parser.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp index 6c3290f4f18..904f1a31892 100644 --- a/src/shared/cplusplus/Parser.cpp +++ b/src/shared/cplusplus/Parser.cpp @@ -2392,8 +2392,7 @@ bool Parser::parseStatement(StatementAST *&node) } case T_AT_SYNCHRONIZED: - if (objCEnabled()) - return parseObjCSynchronizedStatement(node); + return objCEnabled() && parseObjCSynchronizedStatement(node); case T_Q_D: case T_Q_Q: { @@ -2411,7 +2410,6 @@ bool Parser::parseStatement(StatementAST *&node) return parseExpressionOrDeclarationStatement(node); } // switch - return false; } bool Parser::parseBreakStatement(StatementAST *&node) @@ -2746,6 +2744,10 @@ bool Parser::parseCompoundStatement(StatementAST *&node) if (LA() == T_LBRACE) { CompoundStatementAST *ast = new (_pool) CompoundStatementAST; ast->lbrace_token = consumeToken(); + + // ### TODO: the GNU "local label" extension: "__label__ X, Y, Z;" + // These are only allowed at the start of a compound stmt regardless of the language. + StatementListAST **statement_ptr = &ast->statement_list; while (int tk = LA()) { if (tk == T_RBRACE) -- GitLab