diff options
Diffstat (limited to 'src/glsl/ir_validate.cpp')
-rw-r--r-- | src/glsl/ir_validate.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp index 13e41a08901..26d63883422 100644 --- a/src/glsl/ir_validate.cpp +++ b/src/glsl/ir_validate.cpp @@ -63,6 +63,7 @@ public: virtual ir_visitor_status visit_enter(ir_if *ir); + virtual ir_visitor_status visit_enter(ir_loop *ir); virtual ir_visitor_status visit_leave(ir_loop *ir); virtual ir_visitor_status visit_enter(ir_function *ir); virtual ir_visitor_status visit_leave(ir_function *ir); @@ -149,6 +150,18 @@ ir_validate::visit_enter(ir_if *ir) ir_visitor_status +ir_validate::visit_enter(ir_loop *ir) +{ + if (ir->counter != NULL && hash_table_find(ht, ir->counter) != NULL) { + printf("ir_loop @ %p specifies already-declared variable `%s' @ %p\n", + (void *) ir, ir->counter->name, (void *) ir->counter); + abort(); + } + return visit_continue; +} + + +ir_visitor_status ir_validate::visit_leave(ir_loop *ir) { if (ir->counter != NULL) { |