diff options
| author | Jakob Degen <jakob.e.degen@gmail.com> | 2023-01-08 18:23:13 -0800 |
|---|---|---|
| committer | Jakob Degen <jakob.e.degen@gmail.com> | 2023-01-16 14:51:33 -0800 |
| commit | f49126e3d612ec5f7e571a7ccfb3e4447cfa427c (patch) | |
| tree | 7fd525ea22beed96bdb2d98a3cb4c0a0472beb9e /compiler/rustc_data_structures/src/graph | |
| parent | 4781233a77e879e49cb5ce3c98d2abba6a6ade7a (diff) | |
| download | rust-f49126e3d612ec5f7e571a7ccfb3e4447cfa427c.tar.gz rust-f49126e3d612ec5f7e571a7ccfb3e4447cfa427c.zip | |
Document wf constraints on control flow in cleanup blocks
Also fixes a bug in dominator computation
Diffstat (limited to 'compiler/rustc_data_structures/src/graph')
| -rw-r--r-- | compiler/rustc_data_structures/src/graph/dominators/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/graph/dominators/mod.rs b/compiler/rustc_data_structures/src/graph/dominators/mod.rs index ea2a4388b92..07b1ace2189 100644 --- a/compiler/rustc_data_structures/src/graph/dominators/mod.rs +++ b/compiler/rustc_data_structures/src/graph/dominators/mod.rs @@ -135,7 +135,10 @@ pub fn dominators<G: ControlFlowGraph>(graph: G) -> Dominators<G::Node> { // This loop computes the semi[w] for w. semi[w] = w; for v in graph.predecessors(pre_order_to_real[w]) { - let v = real_to_pre_order[v].unwrap(); + // Reachable vertices may have unreachable predecessors, so ignore any of them + let Some(v) = real_to_pre_order[v] else { + continue + }; // eval returns a vertex x from which semi[x] is minimum among // vertices semi[v] +> x *> v. |
