summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-09-03 01:29:38 -0700
committerKenneth Graunke <[email protected]>2015-09-23 10:59:59 -0700
commit6a67ede6b33cfb3bc35d09dcd25a731cba3b7780 (patch)
tree8276e2c646199798d18fa60bab4985a34de3d1c1
parent8dcbca59572a856ca554af9ab3f52120b6f2a929 (diff)
nir: Validate that a block doesn't have two identical successors.
This is invalid, and causes disasters if we try to unlink successors: removing the first will work, but removing the second copy will fail because the block isn't in the successor's predecessor set any longer. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/glsl/nir/nir_validate.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c
index 9938c0ef8b1..1c9993a9c80 100644
--- a/src/glsl/nir/nir_validate.c
+++ b/src/glsl/nir/nir_validate.c
@@ -586,6 +586,7 @@ validate_block(nir_block *block, validate_state *state)
}
assert(block->successors[0] != NULL);
+ assert(block->successors[0] != block->successors[1]);
for (unsigned i = 0; i < 2; i++) {
if (block->successors[i] != NULL) {