diff options
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r-- | ast_to_hir.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index ddd4b73266..33eb27533f 100644 --- a/ast_to_hir.cpp +++ b/ast_to_hir.cpp @@ -523,12 +523,15 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, * ends up not being used, the temp will get copy-propagated out. */ ir_variable *var = new(ctx) ir_variable(rhs->type, "assignment_tmp"); - instructions->push_tail(new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var), + ir_dereference_variable *deref_var = new(ctx) ir_dereference_variable(var); + instructions->push_tail(var); + instructions->push_tail(new(ctx) ir_assignment(deref_var, rhs, NULL)); + deref_var = new(ctx) ir_dereference_variable(var); instructions->push_tail(new(ctx) ir_assignment(lhs, - new(ctx) ir_dereference_variable(var), + deref_var, NULL)); return new(ctx) ir_dereference_variable(var); |