summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-06-23 14:57:47 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-06-23 15:20:29 -0700
commita9d58ad6c9ca4243c8a4b35fbf562c8123593a05 (patch)
treeab8b905765e2ec41e70f7908ecd4b7fbcb397364
parent2731a739d047e4aadc1cab4bcf8c01c1cf8e86db (diff)
Fix double usage of the post-inc/dec's temporary pre-inc/dec copy.linker
Fixes CorrectSwizzle3.frag.
-rw-r--r--ast_to_hir.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index 61e0d01..c70f0f9 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -555,21 +555,20 @@ static ir_rvalue *
get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue)
{
ir_variable *var;
- ir_rvalue *var_deref;
/* FINISHME: Give unique names to the temporaries. */
- var = new ir_variable(lvalue->type, "_internal_tmp");
+ var = new ir_variable(lvalue->type, "_post_incdec_tmp");
var->mode = ir_var_auto;
- var_deref = new ir_dereference_variable(var);
- instructions->push_tail(new ir_assignment(var_deref, lvalue, NULL));
+ instructions->push_tail(new ir_assignment(new ir_dereference_variable(var),
+ lvalue, NULL));
/* Once we've created this temporary, mark it read only so it's no
* longer considered an lvalue.
*/
var->read_only = true;
- return var_deref;
+ return new ir_dereference_variable(var);
}