i965: Fix invalid pointer read in dead_control_flow_eliminate().
There may not be a previous block. In this case, there's no real work to do, so just continue on to the next one. v2: Update for bblock->prev() API change. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
@@ -42,6 +42,10 @@ dead_control_flow_eliminate(backend_shader *s)
|
||||
|
||||
foreach_block_safe (block, s->cfg) {
|
||||
bblock_t *prev_block = block->prev();
|
||||
|
||||
if (!prev_block)
|
||||
continue;
|
||||
|
||||
backend_instruction *const inst = block->start();
|
||||
backend_instruction *const prev_inst = prev_block->end();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user