summaryrefslogtreecommitdiff
path: root/glsl_parser.ypp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-06-07 18:49:48 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-06-07 18:49:48 -0700
commit6cd2a5cc4b8eb1d445f2ae5311db8fda9d46b7a1 (patch)
treebeb6bfdead9f6f4d89ff19f09365102537b18586 /glsl_parser.ypp
parent603b8fc4b2442c93146f9ec0176a5784d9296c9d (diff)
Generate an error on empty declaration lists
This causes an error for code such as 'float;'
Diffstat (limited to 'glsl_parser.ypp')
-rw-r--r--glsl_parser.ypp9
1 files changed, 7 insertions, 2 deletions
diff --git a/glsl_parser.ypp b/glsl_parser.ypp
index 86ec6f5842..a2ce2af877 100644
--- a/glsl_parser.ypp
+++ b/glsl_parser.ypp
@@ -779,8 +779,13 @@ init_declarator_list:
single_declaration:
fully_specified_type
{
- $$ = new ast_declarator_list($1);
- $$->set_location(yylloc);
+ if ($1->specifier->type_specifier != ast_struct) {
+ _mesa_glsl_error(& @1, state, "empty declaration list\n");
+ YYERROR;
+ } else {
+ $$ = new ast_declarator_list($1);
+ $$->set_location(yylloc);
+ }
}
| fully_specified_type IDENTIFIER
{