glsl: Refactor AST-to-HIR code handling variable redeclarations
[mesa.git] / src / glsl / opt_algebraic.cpp
index 3c9af85f312bd17b2ab3143d7dee4c9f9dbf8251..cade9611dbbe2428bd44ad16d7029579b33a0e5d 100644 (file)
@@ -123,8 +123,8 @@ ir_algebraic_visitor::reassociate_constant(ir_expression *ir1, int const_index,
 
    /* Don't want to even think about matrices. */
    if (ir1->operands[0]->type->is_matrix() ||
-       ir1->operands[0]->type->is_matrix() ||
-       ir2->operands[1]->type->is_matrix() ||
+       ir1->operands[1]->type->is_matrix() ||
+       ir2->operands[0]->type->is_matrix() ||
        ir2->operands[1]->type->is_matrix())
       return false;
 
@@ -191,7 +191,7 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
    }
 
    if (this->mem_ctx == NULL)
-      this->mem_ctx = talloc_parent(ir);
+      this->mem_ctx = ralloc_parent(ir);
 
    switch (ir->operation) {
    case ir_unop_logic_not: {