mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 06:40:08 +01:00
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:
parent
9486614938
commit
da5d08707b
1 changed files with 4 additions and 0 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue