i965: Ensure that we end instruction streams properly.
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 9 Jun 2014 10:00:04 +0000 (12:00 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Mon, 9 Jun 2014 10:00:04 +0000 (12:00 +0200)
Threads must terminate with a SEND message to a particular shared function,
such as a URB write or FB write, so the instruction stream really shouldn't
ever end in an IF/ELSE/ENDIF or similar block structure.

However, if the instruction stream (incorrectly) ends in a block structure
the last block's end pointer will not be set, leading to a crash later on in
fs_live_variables::setup_def_use(). It is better to detect this earlier, so
assert on that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_cfg.cpp

index 6bf99f17f5855c4037e6341b75d8d2885a6093ec..9d6eeb37523b36792564082764eb7d7814a6f5c6 100644 (file)
@@ -257,6 +257,8 @@ cfg_t::cfg_t(exec_list *instructions)
       }
    }
 
+   assert(cur->end);
+
    cur->end_ip = ip;
 
    make_block_array();