From 3e0e9e3bf9e597eb74b06381b3418c958be4d452 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sat, 25 Jan 2014 11:57:02 -0800 Subject: glcpp: Check version_resolved in the proper place. The check was in the wrong place, such that if a shader incorrectly put a preprocessor token before the #version declaration, the version would be resolved twice, leading to a segmentation fault when attempting to redefine the __VERSION__ macro. #extension GL_ARB_sample_shading: require #version 130 void main() {} Also, rename glcpp_parser_resolve_version to glcpp_parser_resolve_implicit_version to avoid confusion. Reviewed-by: Jordan Justen Reviewed-by: Carl Worth Reviewed-by: Ian Romanick --- src/glsl/glcpp/pp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glsl/glcpp/pp.c') diff --git a/src/glsl/glcpp/pp.c b/src/glsl/glcpp/pp.c index 637a58f9cc3..fc645f7a195 100644 --- a/src/glsl/glcpp/pp.c +++ b/src/glsl/glcpp/pp.c @@ -151,7 +151,7 @@ glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log, if (parser->skip_stack) glcpp_error (&parser->skip_stack->loc, parser, "Unterminated #if\n"); - glcpp_parser_resolve_version(parser); + glcpp_parser_resolve_implicit_version(parser); ralloc_strcat(info_log, parser->info_log); -- cgit v1.2.3