diff options
author | Matt Turner <[email protected]> | 2013-07-12 11:05:38 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2013-07-15 13:02:36 -0700 |
commit | c889df3fbed64be8669d21e3d3c5d6db913255da (patch) | |
tree | 8db593436310f8bd61205343fd9f675c1f5fdd56 /src/gallium/drivers | |
parent | 7706e52b2549bb862c066a28cd57c2402ff5b3d7 (diff) |
glsl: Reject C-style initializers with unknown types.
_mesa_ast_set_aggregate_type walks through declarations initialized with
C-style aggregate initializers and stops when it runs out of LHS
declarations or RHS expressions.
In the example
vec4 v = {{{1, 2, 3, 4}}};
_mesa_ast_set_aggregate_type would not recurse into the subexpressions
(since vec4s do not contain types that can be initialized with an
aggregate initializer) to set their <constructor_type>s. Later in ::hir
we would dereference the NULL pointer and segfault.
If <constructor_type> is NULL in ::hir we know that the LHS and RHS
were unbalanced and the code is illegal.
Arrays, structs, and matrices were unaffected.
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
0 files changed, 0 insertions, 0 deletions