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
......@@ -5142,8 +5142,6 @@ bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&node, SpecifierListAS
if (!parseObjCPropertyAttribute(last->value)) {
_translationUnit->error(_tokenIndex, "expected token `%s' got `%s'",
Token::name(T_IDENTIFIER), tok().spell());
while (LA() != T_RPAREN)
consumeToken();
break;
}
}
......@@ -5152,9 +5150,11 @@ bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&node, SpecifierListAS
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;
else
_translationUnit->error(_tokenIndex, "expected a simple declaration");
node = ast;
return true;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment