glcpp: Check version_resolved in the proper place.
authorMatt Turner <mattst88@gmail.com>
Sat, 25 Jan 2014 19:57:02 +0000 (11:57 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 28 Jan 2014 05:15:35 +0000 (21:15 -0800)
commit3e0e9e3bf9e597eb74b06381b3418c958be4d452
treefce160f92ee606b088d78b9ee9d3ea64b9f32b4d
parenta818bf481a5e75feaed0afe44b0b80dc8017374f
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 <jordan.l.justen@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/glcpp/glcpp-parse.y
src/glsl/glcpp/glcpp.h
src/glsl/glcpp/pp.c