On 6 July 2011 12:18, Ian Romanick <i...@freedesktop.org> wrote:
>> +   /**
>> +    * If the block ends in a conditional or unconditional break, lower
>> +    * it, even though should_lower_jump() says it needn't be lowered.
>> +    */
>> +   void lower_final_breaks(exec_list *block)
>> +   {
>> +      ir_instruction *ir = (ir_instruction *) block->get_tail();
>> +      lower_break_unconditionally(ir);
>> +      ir_if *ir_if = ir->as_if();
>> +      lower_break_unconditionally(
>> +          (ir_instruction *) ir_if->then_instructions.get_tail());
>> +      lower_break_unconditionally(
>> +          (ir_instruction *) ir_if->else_instructions.get_tail());
>
> This looks suspicious.  How do we know that the tail of the block is
> always an if-statement?  If as_if returns NULL, this will explode.

Whoops, you're right of course.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to