[Mesa-stable] [PATCH 04/15] glsl: Add preprocessor error condition for #else directive
Anuj Phogat
anuj.phogat at gmail.com
Fri Jun 6 16:57:00 PDT 2014
Fixes gles3 Khronos CTS tests:
tokens_after_else_vertex
tokens_after_else_fragment
Cc: <mesa-stable at lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
src/glsl/glcpp/glcpp-lex.l | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l
index 188e454..393db81 100644
--- a/src/glsl/glcpp/glcpp-lex.l
+++ b/src/glsl/glcpp/glcpp-lex.l
@@ -221,6 +221,10 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
return HASH_ELSE;
}
+{HASH}else{HSPACE}*[^ \t\n]+ {
+ glcpp_error(yylloc, yyextra, "illegal tokens after #else");
+}
+
{HASH}endif {
yyextra->space_tokens = 0;
return HASH_ENDIF;
--
1.8.3.1
More information about the mesa-stable
mailing list