[SILGen] Ensure that we don't emit a skipped isolated deinit

Fixes rdar://154373088 / issue #82523
This commit is contained in:
Doug Gregor
2025-06-26 14:01:22 -07:00
parent c6b7b1f6b8
commit 5552d37668
2 changed files with 4 additions and 1 deletions

View File

@@ -1663,7 +1663,7 @@ void SILGenModule::emitObjCAllocatorDestructor(ClassDecl *cd,
// Emit the isolated deallocating destructor.
// If emitted, it implements actual deallocating and deallocating destructor
// only switches executor
if (dd->hasBody() && isActorIsolated) {
if (dd->hasBody() && !dd->isBodySkipped() && isActorIsolated) {
SILDeclRef dealloc(dd, SILDeclRef::Kind::IsolatedDeallocator);
emitFunctionDefinition(dealloc, getFunction(dealloc, ForDefinition));
}

View File

@@ -2,6 +2,9 @@
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-string-processing-module-import -target %target-future-triple -parse-as-library -emit-silgen -DSILGEN %s | %FileCheck %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-string-processing-module-import -target %target-future-triple -parse-as-library -emit-silgen -DSILGEN %s | %FileCheck -check-prefix=CHECK-SYMB %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-string-processing-module-import -target %target-future-triple -parse-as-library -emit-module -DSILGEN -experimental-skip-non-inlinable-function-bodies-without-types %s
// REQUIRES: concurrency
// REQUIRES: objc_interop