[Mesa-dev] [PATCH 1/2] glcpp: Check version_resolved in the proper place.

Carl Worth cworth at cworth.org
Mon Jan 27 14:34:08 PST 2014


Matt Turner <mattst88 at gmail.com> writes:
> 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.

This fix looks good. And the renamed does help, so thanks!

While you're at it, you might fix the typo in the comment above that
function:

	/* GLSL version is no version is explicitly specified. */
	#define IMPLICIT_GLSL_VERSION 110

(The first "is" should be "if").

And the fact that this segmentation-fault has been there with a late
#version suggestions that we haven't had any piglit test for this
case. Presumably we should emit a warning that the late #version is
being ignored?

Regardless,

Reviewed-by: Carl Worth <cworth at cworth.org>

-Carl

-- 
carl.d.worth at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140127/3946fa8b/attachment.pgp>


More information about the mesa-dev mailing list