ir_to_mesa: Don't assert over assignments with a constant-true condition.
authorEric Anholt <eric@anholt.net>
Wed, 19 May 2010 23:06:37 +0000 (16:06 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 24 Jun 2010 22:05:21 +0000 (15:05 -0700)
ir_to_mesa.cpp

index edc95eb5caa800f33dcd4ea80a9053a67790455a..4238d9a8c81489bb0a3d48026d45a3106befafdf 100644 (file)
@@ -824,7 +824,13 @@ ir_to_mesa_visitor::visit(ir_assignment *ir)
    assert(l);
    assert(r);
 
-   assert(!ir->condition);
+   if (ir->condition) {
+        ir_constant *condition_constant;
+
+        condition_constant = ir->condition->constant_expression_value();
+
+        assert(condition_constant && condition_constant->value.b[0]);
+   }
 
    t = this->create_tree(MB_TERM_assign, ir, l, r);
    mono_burg_label(t, NULL);