diff options
author | Timothy Arceri <[email protected]> | 2016-05-30 12:16:39 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-05-30 12:47:58 +1000 |
commit | 87fb5aa3e741e9b93bf09509ff14d4cbc683e482 (patch) | |
tree | 1e6482f9044755e4fb606e1d875cb1d9084580d5 /src | |
parent | d98d6e6269167230d20efdc45d608435a52f25fb (diff) |
glsl: dont crash when attempting to assign a value to a builtin define
For example GL_ARB_enhanced_layouts = 3;
Fixes:
GL44-CTS.enhanced_layouts.glsl_contant_immutablity
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/glsl/ast_to_hir.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index ccacd266bb4..400d3c4e908 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -822,7 +822,7 @@ validate_assignment(struct _mesa_glsl_parse_state *state, */ 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) { + if (var && var->data.mode == ir_var_shader_out && !var->data.patch) { ir_rvalue *index = find_innermost_array_index(lhs); ir_variable *index_var = index ? index->variable_referenced() : NULL; if (!index_var || strcmp(index_var->name, "gl_InvocationID") != 0) { |