summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_control_flow.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/nir/nir_control_flow.c')
-rw-r--r--src/glsl/nir/nir_control_flow.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c
index 91788adb85f..9ae113f3959 100644
--- a/src/glsl/nir/nir_control_flow.c
+++ b/src/glsl/nir/nir_control_flow.c
@@ -57,7 +57,8 @@ static void
link_blocks(nir_block *pred, nir_block *succ1, nir_block *succ2)
{
pred->successors[0] = succ1;
- block_add_pred(succ1, pred);
+ if (succ1 != NULL)
+ block_add_pred(succ1, pred);
pred->successors[1] = succ2;
if (succ2 != NULL)