Skip to content

Commit d634e00

Browse files
committed
[move-only] Comment emitMoveOnlyMemberDestruction drop_deinit
1 parent 8ccabbd commit d634e00

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SILGen/SILGenDestructor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ void SILGenFunction::emitMoveOnlyMemberDestruction(SILValue selfValue,
499499
NominalTypeDecl *nom,
500500
CleanupLocation cleanupLoc,
501501
SILBasicBlock *finishBB) {
502+
// drop_deinit must be used to invalidate any user-defined struct/enum deinit
503+
// before the individual members can be destroyed.
502504
selfValue = B.createDropDeinit(cleanupLoc, selfValue);
503505
if (selfValue->getType().isAddress()) {
504506
if (auto *structDecl = dyn_cast<StructDecl>(nom)) {

0 commit comments

Comments
 (0)