From: Matt Turner Date: Wed, 29 Jan 2014 20:48:51 +0000 (-0800) Subject: glcpp: Reject #version after the version has been resolved. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f49a8c9a5b6f72eef05fa0382bb8c0db714f492;p=mesa.git glcpp: Reject #version after the version has been resolved. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74166 Reviewed-by: Jordan Justen Reviewed-by: Carl Worth --- diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index 17bc649ca5a..0393ac7c416 100644 --- a/src/glsl/glcpp/glcpp-parse.y +++ b/src/glsl/glcpp/glcpp-parse.y @@ -375,9 +375,15 @@ control_line: _glcpp_parser_skip_stack_pop (parser, & @1); } NEWLINE | HASH_VERSION integer_constant NEWLINE { + if (parser->version_resolved) { + glcpp_error(& @1, parser, "#version must appear on the first line"); + } _glcpp_parser_handle_version_declaration(parser, $2, NULL, true); } | HASH_VERSION integer_constant IDENTIFIER NEWLINE { + if (parser->version_resolved) { + glcpp_error(& @1, parser, "#version must appear on the first line"); + } _glcpp_parser_handle_version_declaration(parser, $2, $3, true); } | HASH NEWLINE {