summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/ir_constant_expression.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/ir_constant_expression.cpp b/src/compiler/glsl/ir_constant_expression.cpp
index 4a0aff72c6f..c9788c70535 100644
--- a/src/compiler/glsl/ir_constant_expression.cpp
+++ b/src/compiler/glsl/ir_constant_expression.cpp
@@ -826,7 +826,7 @@ ir_dereference_array::constant_expression_value(void *mem_ctx,
const unsigned component = idx->value.u[0];
return new(mem_ctx) ir_constant(array, component);
- } else {
+ } else if (array->type->is_array()) {
const unsigned index = idx->value.u[0];
return array->get_array_element(index)->clone(mem_ctx, NULL);
}