Mesa (glsl2): glsl2: When stealing var->constant_value, steal its children as well.

Eric Anholt anholt at kemper.freedesktop.org
Tue Jul 27 22:30:03 UTC 2010


Module: Mesa
Branch: glsl2
Commit: f9b0e5e322a676cf778dc3785281040fcc0bd248
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9b0e5e322a676cf778dc3785281040fcc0bd248

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jul 27 15:25:07 2010 -0700

glsl2: When stealing var->constant_value, steal its children as well.

Fixes:
glsl1-GLSL 1.20 uniform array constructor

---

 src/glsl/ir.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 6dccbd8..c75d560 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -911,7 +911,7 @@ steal_memory(ir_instruction *ir, void *new_ctx)
    ir_variable *var = ir->as_variable();
    ir_constant *constant = ir->as_constant();
    if (var != NULL && var->constant_value != NULL)
-      talloc_steal(ir, var->constant_value);
+      steal_memory(var->constant_value, ir);
 
    /* The components of aggregate constants are not visited by the normal
     * visitor, so steal their values by hand.




More information about the mesa-commit mailing list