summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-08-31 16:35:21 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-09-02 11:24:09 -0700
commit9a4d76e534920a54c28092311ab6da90c6d7b8d3 (patch)
tree20c4b85088b50f54518626ea57be4e38fc96273b /src/compiler/nir
parentea7b47596824fd38bd9ad25e49626d8a7d821806 (diff)
downloadexternal_mesa3d-9a4d76e534920a54c28092311ab6da90c6d7b8d3.zip
external_mesa3d-9a4d76e534920a54c28092311ab6da90c6d7b8d3.tar.gz
external_mesa3d-9a4d76e534920a54c28092311ab6da90c6d7b8d3.tar.bz2
nir/dead_cf: Don't crash on unreachable after-loop blocks
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_opt_dead_cf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_opt_dead_cf.c b/src/compiler/nir/nir_opt_dead_cf.c
index 3551124..1490e68 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;