We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents eb8e984 + 1126561 commit bbc1d8fCopy full SHA for bbc1d8f
lib/SILGen/SILGenDecl.cpp
@@ -528,6 +528,12 @@ class LocalVariableInitialization : public SingleBufferInitialization {
528
if (SGF.getASTContext().SILOpts.supportsLexicalLifetimes(SGF.getModule())) {
529
auto loweredType = SGF.getTypeLowering(decl->getType()).getLoweredType();
530
auto lifetime = SGF.F.getLifetime(decl, loweredType);
531
+ // The box itself isn't lexical--neither a weak reference nor an unsafe
532
+ // pointer to a box can be formed; and the box doesn't synchronize on
533
+ // deinit.
534
+ //
535
+ // Only add a lexical lifetime to the box if the the variable it stores
536
+ // requires one.
537
if (lifetime.isLexical()) {
538
Box = SGF.B.createBeginBorrow(decl, Box, /*isLexical=*/true);
539
}
0 commit comments