summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index e12aa5d80f5..7ae46845191 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -1641,7 +1641,10 @@ nir_index_blocks(nir_function_impl *impl)
block->index = index++;
}
- impl->num_blocks = index;
+ /* The end_block isn't really part of the program, which is why its index
+ * is >= num_blocks.
+ */
+ impl->num_blocks = impl->end_block->index = index;
}
static bool