Skip to content

Commit 4f773c2

Browse files
committed
[SILGen] Ensure that we have a scope for error conversions in reabstraction thunks
1 parent 4bbfba7 commit 4f773c2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/SILGen/SILGenApply.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5727,6 +5727,8 @@ SILValue SILGenFunction::emitApplyWithRethrow(SILLocation loc, SILValue fn,
57275727
{
57285728
B.emitBlock(errorBB);
57295729

5730+
Scope scope(Cleanups, CleanupLocation(loc));
5731+
57305732
// Grab the inner error.
57315733
SILValue innerError;
57325734
bool hasInnerIndirectError = fnConv.hasIndirectSILErrorResults();

test/Profiler/coverage_closure_returns_never.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// CHECK-NOT: increment_profiler_counter
77
// CHECK: [[LOAD:%.*]] = load {{.*}} : $*Never
88
// CHECK-NEXT: debug_value [[LOAD]] : $Never
9-
// CHECK-NEXT: debug_value undef : $any Error, var, name "$error", argno
109
// CHECK-NEXT: unreachable
1110

1211
func closure_with_fatal_error(_ arr: [Never]) {

0 commit comments

Comments
 (0)