summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ir.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 8ebef7d95a3..2fd654e9bfe 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -908,6 +908,9 @@ visit_exec_list(exec_list *list, ir_visitor *visitor)
static void
steal_memory(ir_instruction *ir, void *new_ctx)
{
+ ir_variable *var = ir->as_variable();
+ if (var != NULL && var->constant_value != NULL)
+ talloc_steal(ir, var->constant_value);
talloc_steal(new_ctx, ir);
}