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 <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
Kenneth Graunke
2015-09-03 01:29:38 -07:00
parent 8dcbca5957
commit 6a67ede6b3
+1
View File
@@ -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) {