Skip to content

Commit d283aa0

Browse files
committed
[cxx-interop] Destroy things 🤷
1 parent 9d5d624 commit d283aa0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎lib/IRGen/GenStruct.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ namespace {
558558
if (auto ctor = dyn_cast<clang::CXXConstructorDecl>(method)) {
559559
if (ctor->isCopyConstructor() &&
560560
ctor->getAccess() == clang::AS_public &&
561-
ctor->doesThisDeclarationHaveABody() &&
561+
// rdar://106964356
562+
// ctor->doesThisDeclarationHaveABody() &&
562563
!ctor->isDeleted())
563564
return ctor;
564565
}
@@ -809,6 +810,7 @@ namespace {
809810
emitCopyWithCopyConstructor(IGF, T, moveConstructor,
810811
src.getAddress(),
811812
dest.getAddress());
813+
destroy(IGF, src, T, isOutlined);
812814
return;
813815
}
814816

@@ -828,9 +830,11 @@ namespace {
828830
void assignWithTake(IRGenFunction &IGF, Address dest, Address src, SILType T,
829831
bool isOutlined) const override {
830832
if (auto moveConstructor = findMoveConstructor()) {
833+
destroy(IGF, dest, T, isOutlined);
831834
emitCopyWithCopyConstructor(IGF, T, moveConstructor,
832835
src.getAddress(),
833836
dest.getAddress());
837+
destroy(IGF, src, T, isOutlined);
834838
return;
835839
}
836840

0 commit comments

Comments
 (0)