summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_print_visitor.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-11-10 16:33:10 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-11-19 15:00:25 -0800
commitfc92e87b9757eda01caf0bb3e2c31b1dbbd73aa0 (patch)
tree0166f7ad2f9b19794f8a65b0b050fe4dc4cd083a /src/glsl/ir_print_visitor.cpp
parentf2616e56de8a48360cae8f269727b58490555f4d (diff)
downloadexternal_mesa3d-fc92e87b9757eda01caf0bb3e2c31b1dbbd73aa0.zip
external_mesa3d-fc92e87b9757eda01caf0bb3e2c31b1dbbd73aa0.tar.gz
external_mesa3d-fc92e87b9757eda01caf0bb3e2c31b1dbbd73aa0.tar.bz2
glsl: Eliminate assumptions about size of ir_expression::operands
This may grow in the near future.
Diffstat (limited to 'src/glsl/ir_print_visitor.cpp')
-rw-r--r--src/glsl/ir_print_visitor.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp
index 5c19db1..e5067bf 100644
--- a/src/glsl/ir_print_visitor.cpp
+++ b/src/glsl/ir_print_visitor.cpp
@@ -182,11 +182,10 @@ void ir_print_visitor::visit(ir_expression *ir)
printf(" %s ", ir->operator_string());
- if (ir->operands[0])
- ir->operands[0]->accept(this);
+ for (unsigned i = 0; i < ir->get_num_operands(); i++) {
+ ir->operands[i]->accept(this);
+ }
- if (ir->operands[1])
- ir->operands[1]->accept(this);
printf(") ");
}