OSDN Git Service

glsl: In update_max_array_access, fix interface instance check.
authorPaul Berry <stereotype441@gmail.com>
Tue, 15 Oct 2013 16:43:22 +0000 (09:43 -0700)
committerPaul Berry <stereotype441@gmail.com>
Thu, 17 Oct 2013 18:51:06 +0000 (11:51 -0700)
commite2d1eaa32a83204646bcccc029fdd31dbaee6d5e
tree825f628a176630924f3cb291feacc91066d09093
parent79e835a71202f1a6e112266b199e833d952da606
glsl: In update_max_array_access, fix interface instance check.

In commit f878d20 (glsl: Update ir_variable::max_ifc_array_access
properly), I accidentally used the wrong kind of check to determine
whether the variable being accessed was an interface instance (I used
var->get_interface_type() != NULL when I should have used
var->is_interface_instance()).  As a result, if an unnamed interface
block contained a struct which contained an array,
update_max_array_access() would mistakenly interpret the struct as a
named interface block and try to dereference a null
var->max_ifc_array_access.

This patch corrects the check, fixing the null dereference.

Fixes piglit test interface-block-struct-nesting.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70368

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/ast_array_index.cpp