summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_validate.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-08-02 12:08:52 -0700
committerEric Anholt <[email protected]>2010-08-02 12:08:52 -0700
commitee7666b5ac2fc7de64baf60835271e15baf89474 (patch)
tree366d31e7d3297e827a9ae4d62a125c395d7176af /src/glsl/ir_validate.cpp
parente75dbf66d011d76b6944dc4ee55e339ee285510c (diff)
glsl2: Add validation that talloc ownership of ir_* names is right.
Diffstat (limited to 'src/glsl/ir_validate.cpp')
-rw-r--r--src/glsl/ir_validate.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 1dfac828269..f9f781b36ab 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -139,7 +139,7 @@ ir_validate::visit_enter(ir_function *ir)
ir_visitor_status
ir_validate::visit_leave(ir_function *ir)
{
- (void) ir;
+ assert(talloc_parent(ir->name) == ir);
this->current_function = NULL;
return visit_continue;
@@ -313,6 +313,8 @@ ir_validate::visit(ir_variable *ir)
* in the ir_dereference_variable handler to ensure that a variable is
* declared before it is dereferenced.
*/
+ assert(talloc_parent(ir->name) == ir);
+
hash_table_insert(ht, ir, ir);
return visit_continue;
}