summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-01-29 12:48:51 -0800
committerMatt Turner <[email protected]>2014-01-31 10:21:50 -0800
commit3f49a8c9a5b6f72eef05fa0382bb8c0db714f492 (patch)
tree9b3a1826aeb5748a9ee011df03ad1363608afb87 /src
parent9d4a6bd6bb4daf04a2ff2e0d2c01691c4e5d84be (diff)
glcpp: Reject #version after the version has been resolved.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74166 Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Carl Worth <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/glcpp/glcpp-parse.y6
1 files changed, 6 insertions, 0 deletions
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 {