summaryrefslogtreecommitdiff
path: root/src/glsl/ir_hv_accept.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-08-05 15:29:24 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-09-03 11:55:21 -0700
commitc8ee8e07f7cc8f18d367ffcec065b45f8a6976f4 (patch)
tree5f39dcf62ff8f2cb6799c023995fabce2d2ab121 /src/glsl/ir_hv_accept.cpp
parent29eebe9a9a0486f12e33e2818c192ef683fdfede (diff)
glsl2: Set a flag when visiting the assignee of an assignment
Diffstat (limited to 'src/glsl/ir_hv_accept.cpp')
-rw-r--r--src/glsl/ir_hv_accept.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/ir_hv_accept.cpp b/src/glsl/ir_hv_accept.cpp
index 6dae4ed2f3..be8b36a7cf 100644
--- a/src/glsl/ir_hv_accept.cpp
+++ b/src/glsl/ir_hv_accept.cpp
@@ -242,7 +242,14 @@ ir_dereference_array::accept(ir_hierarchical_visitor *v)
if (s != visit_continue)
return (s == visit_continue_with_parent) ? visit_continue : s;
+ /* 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 = v->in_assignee;
+ v->in_assignee = false;
s = this->array_index->accept(v);
+ v->in_assignee = was_in_assignee;
+
if (s != visit_continue)
return (s == visit_continue_with_parent) ? visit_continue : s;
@@ -270,7 +277,9 @@ ir_assignment::accept(ir_hierarchical_visitor *v)
if (s != visit_continue)
return (s == visit_continue_with_parent) ? visit_continue : s;
+ v->in_assignee = true;
s = this->lhs->accept(v);
+ v->in_assignee = false;
if (s != visit_continue)
return (s == visit_continue_with_parent) ? visit_continue : s;