summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_rvalue_visitor.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-08-05 15:29:24 -0700
committerIan Romanick <[email protected]>2010-09-03 11:55:21 -0700
commitc8ee8e07f7cc8f18d367ffcec065b45f8a6976f4 (patch)
tree5f39dcf62ff8f2cb6799c023995fabce2d2ab121 /src/glsl/ir_rvalue_visitor.cpp
parent29eebe9a9a0486f12e33e2818c192ef683fdfede (diff)
glsl2: Set a flag when visiting the assignee of an assignment
Diffstat (limited to 'src/glsl/ir_rvalue_visitor.cpp')
-rw-r--r--src/glsl/ir_rvalue_visitor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/ir_rvalue_visitor.cpp b/src/glsl/ir_rvalue_visitor.cpp
index 613b07c3029..773bfcfa3ec 100644
--- a/src/glsl/ir_rvalue_visitor.cpp
+++ b/src/glsl/ir_rvalue_visitor.cpp
@@ -83,7 +83,14 @@ ir_rvalue_visitor::visit_leave(ir_swizzle *ir)
ir_visitor_status
ir_rvalue_visitor::visit_leave(ir_dereference_array *ir)
{
+ /* The array index is not the target of the assignment, so clear the
+ * 'in_assignee' flag. Restore it after returning from the array index.
+ */
+ const bool was_in_assignee = this->in_assignee;
+ this->in_assignee = false;
handle_rvalue(&ir->array_index);
+ this->in_assignee = was_in_assignee;
+
handle_rvalue(&ir->array);
return visit_continue;
}