Assert that sealed blocks cannot accept new predecessors.

This commit is contained in:
Dan Gohman
2017-11-01 11:27:54 -07:00
parent 1663f141c8
commit 39c0fbb6c7

View File

@@ -90,6 +90,7 @@ impl<Variable> BlockData<Variable> {
match *self {
BlockData::EbbBody { .. } => panic!("you can't add a predecessor to a body block"),
BlockData::EbbHeader(ref mut data) => {
debug_assert!(!data.sealed, "sealed blocks cannot accept new predecessors");
data.predecessors.push((pred, inst));
}
}