diff options
author | Paul Berry <stereotype441@gmail.com> | 2013-07-14 08:57:49 -0700 |
---|---|---|
committer | Paul Berry <stereotype441@gmail.com> | 2013-07-15 07:59:52 -0700 |
commit | 428e0302100a82ab8ed5734eabd781ae36882fad (patch) | |
tree | 13fc7a95f475563d28a4a961938c159093411cc1 /src/glsl | |
parent | b2265db8e77b531e380c47bb5bf31a3c0aa36e08 (diff) | |
download | external_mesa3d-428e0302100a82ab8ed5734eabd781ae36882fad.zip external_mesa3d-428e0302100a82ab8ed5734eabd781ae36882fad.tar.gz external_mesa3d-428e0302100a82ab8ed5734eabd781ae36882fad.tar.bz2 |
glsl: Fix lower_named_interface_blocks to account for dereferences of consts.
In certain rare cases (such as those involving dereference of a
literal constant array of structs),
flatten_named_interface_blocks_declarations's rvalue visitor may be
invoked on an ir_dereference_record whose variable_referenced() method
returns NULL.
Check for this case to avoid a segfault.
Prevents crashes in piglit tests
{vs,fs}-deref-literal-array-of-structs.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/lower_named_interface_blocks.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/glsl/lower_named_interface_blocks.cpp b/src/glsl/lower_named_interface_blocks.cpp index 922cc02..d0d491d 100644 --- a/src/glsl/lower_named_interface_blocks.cpp +++ b/src/glsl/lower_named_interface_blocks.cpp @@ -194,6 +194,8 @@ flatten_named_interface_blocks_declarations::handle_rvalue(ir_rvalue **rvalue) return; ir_variable *var = ir->variable_referenced(); + if (var == NULL) + return; if (!var->is_interface_instance()) return; |