From c0127c30ddf0d10c38c36288e44187ec59ccf838 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 1 Jul 2014 17:58:37 -0700 Subject: [PATCH] glsl/glcpp: Fix NULL directives when followed by a single-line comment This is the fix for the following line: # // comment to ignore here According to the translation-phase rules, the comment should be removed before the preprocessor looks to interpret the null directive. So in our implementation we must explicitly look for single-line comments in the start condition as well. This commit fixes the following Khronos GLES3 CTS tests: null_directive_vertex null_directive_fragment Reviewed-by: Ian Romanick --- src/glsl/glcpp/glcpp-lex.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l index 2cfe203dacf..2b92fd37e2b 100644 --- a/src/glsl/glcpp/glcpp-lex.l +++ b/src/glsl/glcpp/glcpp-lex.l @@ -250,7 +250,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? } /* Single-line comments */ -"//"[^\r\n]* { +"//"[^\r\n]* { } /* Multi-line comments */ -- 2.30.2