[Mesa-stable] [Mesa-dev] [PATCH 04/15] glsl: Add preprocessor error condition for #else directive

Tapani Pälli tapani.palli at intel.com
Thu Jun 12 23:42:07 PDT 2014


On 06/07/2014 02:57 AM, Anuj Phogat wrote:
> 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]+ {

I can't find exact specification for a 'new-line' from the spec, so IMO
we should allow '\r' also here.

> +        glcpp_error(yylloc, yyextra, "illegal tokens after #else");
> +}
> +
>  {HASH}endif {
>  	yyextra->space_tokens = 0;
>  	return HASH_ENDIF;

// Tapani



More information about the mesa-stable mailing list