Skip to content

Commit

Permalink
[move-only] Comment emitMoveOnlyMemberDestruction drop_deinit
Browse files Browse the repository at this point in the history
  • Loading branch information
atrick committed Jun 6, 2023
1 parent 9c98ee8 commit 6b53365
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/SILGen/SILGenDestructor.cpp
Expand Up @@ -499,6 +499,8 @@ void SILGenFunction::emitMoveOnlyMemberDestruction(SILValue selfValue,
NominalTypeDecl *nom,
CleanupLocation cleanupLoc,
SILBasicBlock *finishBB) {
// drop_deinit must be used to invalidate any user-defined struct/enum deinit
// before the individual members can be destroyed.
selfValue = B.createDropDeinit(cleanupLoc, selfValue);
if (selfValue->getType().isAddress()) {
if (auto *structDecl = dyn_cast<StructDecl>(nom)) {
Expand Down

0 comments on commit 6b53365

Please sign in to comment.