Skip to content

Commit 8fa3738

Browse files
committed
auto
1 parent 5766124 commit 8fa3738

File tree

2 files changed

+3
-46
lines changed

2 files changed

+3
-46
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161

6262
#include <memory>
6363

64+
#pragma clang optimize off
65+
6466
using namespace swift;
6567

6668
using Lowering::AbstractionPattern;
@@ -7191,7 +7193,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
71917193
state.handleScopeEndingInst(i);
71927194
} else if (!state.Stack.empty() && op == state.Stack.back()) {
71937195
state.Stack.pop_back();
7194-
if (beginInst && isa<BeginApplyInst>(beginInst))
7196+
if (isa_and_nonnull<BeginApplyInst>(beginInst))
71957197
state.handleScopeEndingInst(i);
71967198
} else {
71977199
verificationFailure("deallocating allocation that is not the top of the stack",

test/SIL/verifier_failures.sil

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,6 @@ class C {}
1010

1111
protocol Error {}
1212

13-
// CHECK-LABEL: Begin Error in function end_borrow_1_addr_alloc_stack
14-
// CHECK: SIL verification failed: end_borrow of an address not produced by store_borrow
15-
// CHECK-LABEL: End Error in function end_borrow_1_addr_alloc_stack
16-
sil [ossa] @end_borrow_1_addr_alloc_stack : $@convention(thin) () -> () {
17-
%addr = alloc_stack $C
18-
end_borrow %addr : $*C
19-
dealloc_stack %addr : $*C
20-
%retval = tuple ()
21-
return %retval : $()
22-
}
23-
24-
// CHECK-LABEL: Begin Error in function destroy_value_dead_end
25-
// CHECK: SIL verification failed: a dead_end destroy_value must be in a dead-end block
26-
// CHECK: Verifying instruction:
27-
// CHECK: [[ARGUMENT:%[^,]+]] = argument
28-
// CHECK: -> destroy_value [dead_end] [[ARGUMENT]]
29-
// CHECK-LABEL: End Error in function destroy_value_dead_end
30-
sil [ossa] @destroy_value_dead_end : $@convention(thin) (@owned C) -> () {
31-
entry(%c : @owned $C):
32-
destroy_value [dead_end] %c : $C
33-
%retval = tuple()
34-
return %retval : $()
35-
}
36-
37-
// CHECK-LABEL: Begin Error in function dealloc_box_dead_end
38-
// CHECK: SIL verification failed: a dead_end dealloc_box must be in a dead-end block
39-
// CHECK: Verifying instruction:
40-
// CHECK: [[BOX:%[^,]+]] = alloc_box
41-
// CHECK: -> dealloc_box [dead_end] [[BOX]]
42-
// CHECK-LABEL: End Error in function dealloc_box_dead_end
43-
sil [ossa] @dealloc_box_dead_end : $@convention(thin) () -> () {
44-
%b = alloc_box ${ var C }
45-
dealloc_box [dead_end] %b : ${ var C }
46-
%retval = tuple()
47-
return %retval : $()
48-
}
49-
5013
// CHECK-LABEL: Begin Error in function abort_apply_callee_allocated_coro
5114
// CHECK: SIL verification failed: abort_apply of callee-allocated yield-once coroutine!?
5215
// CHECK: Verifying instruction:
@@ -56,15 +19,7 @@ sil [ossa] @dealloc_box_dead_end : $@convention(thin) () -> () {
5619
sil [ossa] @abort_apply_callee_allocated_coro : $@convention(thin) () -> (@error any Error) {
5720
entry:
5821
(%value, %token, %allocation) = begin_apply undef() : $@yield_once_2 @convention(thin) () -> @yields @in_guaranteed ()
59-
try_apply undef() : $@convention(thin) () -> @error any Error, normal success, error failure
60-
61-
success(%val : $()):
6222
end_apply %token as $()
6323
dealloc_stack %allocation : $*Builtin.SILToken
6424
return undef : $()
65-
66-
failure(%error : @owned $any Error):
67-
abort_apply %token
68-
dealloc_stack %allocation : $*Builtin.SILToken
69-
throw %error : $any Error
7025
}

0 commit comments

Comments
 (0)