[Mesa-dev] [PATCH] glsl2: fix crash with variable indexing into array inside a struct

Ian Romanick idr at freedesktop.org
Wed Aug 25 16:23:44 PDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aras Pranckevicius wrote:
> Hi,
> 
> Attached patch fixes GLSL2 crash on a shader like below.
> whole_variable_referenced() can return NULL if the array in question
> is not a top-level variable.
> 
> struct str {
>   float params[3];
> };
> void main() {
>   str s;
>   for (int i = 0; i < 3; ++i)
>     s.params[i] = 1.0;
>   gl_FragColor = vec4(0.0);
> }

I committed the patch and this test case.  The test is struct-06.frag in
piglit.  Thanks.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx1pf8ACgkQX1gOwKyEAw/LOgCeJjEsBFHCj+wLE9qWPaQyeYWr
2i8AniBMc+j7JVfrD7oOp32kcdqHI7uB
=Y6HC
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list