From: Jason Ekstrand Date: Wed, 31 Aug 2016 23:35:21 +0000 (-0700) Subject: nir/dead_cf: Don't crash on unreachable after-loop blocks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a4d76e534920a54c28092311ab6da90c6d7b8d3;p=mesa.git nir/dead_cf: Don't crash on unreachable after-loop blocks Signed-off-by: Jason Ekstrand Reviewed-by: Connor Abbott --- diff --git a/src/compiler/nir/nir_opt_dead_cf.c b/src/compiler/nir/nir_opt_dead_cf.c index 35511246495..1490e6832a2 100644 --- a/src/compiler/nir/nir_opt_dead_cf.c +++ b/src/compiler/nir/nir_opt_dead_cf.c @@ -205,7 +205,8 @@ loop_is_dead(nir_loop *loop) nir_metadata_require(impl, nir_metadata_live_ssa_defs | nir_metadata_dominance); - for (nir_block *cur = after->imm_dom; cur != before; cur = cur->imm_dom) { + for (nir_block *cur = after->imm_dom; cur && cur != before; + cur = cur->imm_dom) { nir_foreach_instr(instr, cur) { if (!nir_foreach_ssa_def(instr, def_not_live_out, after)) return false;