summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-11-07 18:25:08 -0800
committerJason Ekstrand <[email protected]>2015-01-15 07:19:01 -0800
commitdc4e660dfad86aa8cdd08a5ec8b9890095de7c07 (patch)
tree9a888d9290197d328e9eb7cdcfd35c271b5da075
parent2bd5a24a5e440ba0072528fdb32892cf8c935a8e (diff)
nir/nir: Fix a bug in move_successors
The unlink_blocks function moves successors around to make sure that, if there is a remaining successor, it is in the first successors slot and not the second. To fix this, we simply get both successors up front. Reviewed-by: Connor Abbott <[email protected]>
-rw-r--r--src/glsl/nir/nir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index 56891dc3401..d0e09ebb34e 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -739,10 +739,11 @@ static void
move_successors(nir_block *source, nir_block *dest)
{
nir_block *succ1 = source->successors[0];
+ nir_block *succ2 = source->successors[1];
+
if (succ1)
unlink_blocks(source, succ1);
- nir_block *succ2 = source->successors[1];
if (succ2)
unlink_blocks(source, succ2);