Skip to content

Commit 1499a6f

Browse files
committed
UnwindAction::Terminate edge is also critical edge
1 parent 0412639 commit 1499a6f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_mir_transform/src/add_call_guards.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ impl AddCallGuards {
5353
kind: TerminatorKind::Call { target: Some(ref mut destination), unwind, .. },
5454
source_info,
5555
}) if pred_count[*destination] > 1
56-
&& (matches!(unwind, UnwindAction::Cleanup(_)) || self == &AllCallEdges) =>
56+
&& (matches!(unwind, UnwindAction::Cleanup(_) | UnwindAction::Terminate)
57+
|| self == &AllCallEdges) =>
5758
{
5859
// It's a critical edge, break it
5960
let call_guard = BasicBlockData {

0 commit comments

Comments
 (0)