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

Aras Pranckevicius aras at unity3d.com
Wed Aug 25 12:46:19 PDT 2010


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);

Aras Pranckevičius
work: http://unity3d.com
home: http://aras-p.info
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glsl-fix-crash-with-variable-indexing-into-array-in-.patch
Type: application/octet-stream
Size: 813 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100825/59aa7526/attachment.obj>

More information about the mesa-dev mailing list