[Mesa-dev] [PATCH 01/37] glsl: Fix segfault when lhs is error_type TCS
Timothy Arceri
timothy.arceri at collabora.com
Tue Mar 15 12:56:51 UTC 2016
It seem expected that both lhs and rhs could be of type error_type
in this code however the TCS wasn't expecting it.
Fixes segfault in an enhanced layouts GL CTS test.
---
src/compiler/glsl/ast_to_hir.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index e184407..f29bf1b 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -803,7 +803,7 @@ validate_assignment(struct _mesa_glsl_parse_state *state,
* if the expression indicating the vertex number is not the identifier
* `gl_InvocationID`.
*/
- if (state->stage == MESA_SHADER_TESS_CTRL) {
+ if (state->stage == MESA_SHADER_TESS_CTRL && !lhs->type->is_error()) {
ir_variable *var = lhs->variable_referenced();
if (var->data.mode == ir_var_shader_out && !var->data.patch) {
ir_rvalue *index = find_innermost_array_index(lhs);
--
2.5.0
More information about the mesa-dev
mailing list