i965: Assert that an instruction is not inserted around itself.
authorMatt Turner <mattst88@gmail.com>
Mon, 15 Feb 2016 18:42:14 +0000 (10:42 -0800)
committerMatt Turner <mattst88@gmail.com>
Thu, 31 Mar 2016 02:54:30 +0000 (19:54 -0700)
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/i965/brw_shader.cpp

index 21977a231304ef9efa29c644fdb5b3c902b858eb..736deb443ddf36f26ed9dcced559b9da3f9b1457 100644 (file)
@@ -948,6 +948,8 @@ adjust_later_block_ips(bblock_t *start_block, int ip_adjustment)
 void
 backend_instruction::insert_after(bblock_t *block, backend_instruction *inst)
 {
+   assert(this != inst);
+
    if (!this->is_head_sentinel())
       assert(inst_is_in_block(block, this) || !"Instruction not in block");
 
@@ -961,6 +963,8 @@ backend_instruction::insert_after(bblock_t *block, backend_instruction *inst)
 void
 backend_instruction::insert_before(bblock_t *block, backend_instruction *inst)
 {
+   assert(this != inst);
+
    if (!this->is_tail_sentinel())
       assert(inst_is_in_block(block, this) || !"Instruction not in block");