summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ir_constant_expression.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 186d0c48c12..cb07f381281 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -695,10 +695,7 @@ ir_swizzle::constant_expression_value()
ir_constant *
ir_dereference_variable::constant_expression_value()
{
- ir_variable *var = this->variable_referenced();
- if (var && var->constant_value)
- return var->constant_value->clone(NULL);
- return NULL;
+ return var->constant_value ? var->constant_value->clone(NULL) : NULL;
}