File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,26 @@ void SILGenFunction::emitDestroyingDestructor(DestructorDecl *dd) {
114
114
115
115
auto cd = cast<ClassDecl>(dd->getDeclContext ());
116
116
SILValue selfValue = emitSelfDeclForDestructor (dd->getImplicitSelfDecl ());
117
+ ManagedValue managedSelf;
118
+ if (selfValue->getOwnershipKind () == OwnershipKind::Unowned) {
119
+ managedSelf = ManagedValue::forUnownedObjectValue (selfValue);
120
+ } else {
121
+ managedSelf = ManagedValue::forBorrowedRValue (selfValue);
122
+ }
123
+
124
+ auto ai = swift::getActorIsolation (dd);
125
+ auto actor = emitExecutor (Loc, ai, managedSelf);
126
+ if (actor) {
127
+ ExpectedExecutor = *actor;
128
+ }
129
+
130
+ // Jump to the expected executor.
131
+ if (ExpectedExecutor) {
132
+ // For a synchronous function, check that we're on the same executor.
133
+ // Note: if we "know" that the code is completely Sendable-safe, this
134
+ // is unnecessary. The type checker will need to make this determination.
135
+ emitPreconditionCheckExpectedExecutor (Loc, ExpectedExecutor);
136
+ }
117
137
118
138
// Create a basic block to jump to for the implicit destruction behavior
119
139
// of releasing the elements and calling the superclass destructor.
You can’t perform that action at this time.
0 commit comments