Commit c5cf70c6 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Check for valid decl_specifier_seq when parsing declaration statements.

parent 63c2ceae
......@@ -2402,10 +2402,18 @@ bool Parser::parseNamespaceAliasDefinition(DeclarationAST *&node)
bool Parser::parseDeclarationStatement(StatementAST *&node)
{
unsigned start = cursor();
DeclarationAST *declaration = 0;
if (! parseBlockDeclaration(declaration))
return false;
if (SimpleDeclarationAST *simpleDeclaration = declaration->asSimpleDeclaration()) {
if (! simpleDeclaration->decl_specifier_seq) {
rewind(start);
return false;
}
}
DeclarationStatementAST *ast = new (_pool) DeclarationStatementAST;
ast->declaration = declaration;
node = ast;
......
Markdown is supported
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