Skip to content

Commit 62a5d1c

Browse files
authored
Merge pull request #36159 from eeckstein/fix-hte-verification
SIL: handle hop_to_executor in the LoadBorrowImmutabilityChecker
2 parents 9bf4fe8 + 7336bfa commit 62a5d1c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

lib/SIL/Verifier/LoadBorrowImmutabilityChecker.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ bool GatherWritesVisitor::visitUse(Operand *op, AccessUseType useTy) {
9898
case SILInstructionKind::WitnessMethodInst:
9999
case SILInstructionKind::ExistentialMetatypeInst:
100100
case SILInstructionKind::IsUniqueInst:
101+
case SILInstructionKind::HopToExecutorInst:
101102
return true;
102103

103104
// Known writes...
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// RUN: %target-sil-opt -enable-experimental-concurrency -o /dev/null %s
2+
3+
// REQUIRES: concurrency
4+
5+
sil_stage canonical
6+
7+
import Builtin
8+
import Swift
9+
import SwiftShims
10+
11+
final actor Storage {
12+
@_hasStorage @_hasInitialValue final var resolved: [String] { get set }
13+
init()
14+
}
15+
16+
sil hidden [ossa] @$s3nix3FooV7StorageC3getySSSgSiYF : $@convention(method) @async (@guaranteed Storage) -> () {
17+
bb0(%0 : @guaranteed $Storage):
18+
hop_to_executor %0 : $Storage
19+
%2 = ref_element_addr %0 : $Storage, #Storage.resolved
20+
%3 = begin_access [read] [dynamic] %2 : $*Array<String>
21+
%4 = load_borrow %3 : $*Array<String>
22+
end_borrow %4 : $Array<String>
23+
end_access %3 : $*Array<String>
24+
%r = tuple ()
25+
return %r : $()
26+
}

0 commit comments

Comments
 (0)