Skip to content
Snippets Groups Projects
Commit 007d76aa authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Fixed bug in ObjC class field parsing which could result in an invalid pointer in the AST.

parent 800f4bab
Branches
Tags
No related merge requests found
...@@ -5142,8 +5142,6 @@ bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&node, SpecifierListAS ...@@ -5142,8 +5142,6 @@ bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&node, SpecifierListAS
if (!parseObjCPropertyAttribute(last->value)) { if (!parseObjCPropertyAttribute(last->value)) {
_translationUnit->error(_tokenIndex, "expected token `%s' got `%s'", _translationUnit->error(_tokenIndex, "expected token `%s' got `%s'",
Token::name(T_IDENTIFIER), tok().spell()); Token::name(T_IDENTIFIER), tok().spell());
while (LA() != T_RPAREN)
consumeToken();
break; break;
} }
} }
...@@ -5152,9 +5150,11 @@ bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&node, SpecifierListAS ...@@ -5152,9 +5150,11 @@ bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&node, SpecifierListAS
match(T_RPAREN, &(ast->rparen_token)); match(T_RPAREN, &(ast->rparen_token));
} }
parseSimpleDeclaration(ast->simple_declaration, /*accept-struct-declarators = */ true); if (parseSimpleDeclaration(ast->simple_declaration, /*accept-struct-declarators = */ true))
node = ast; node = ast;
else
_translationUnit->error(_tokenIndex, "expected a simple declaration");
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment