Skip to content

Commit 4da3114

Browse files
committed
Disable generating access scope during emission of borrowed/mutable return
1 parent 282e335 commit 4da3114

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/SILGen/SILGenLValue.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3584,7 +3584,8 @@ void LValue::addNonMemberVarComponent(
35843584

35853585
std::optional<SILAccessEnforcement> enforcement;
35863586
if (!Storage->isLet()) {
3587-
if (Options.IsNonAccessing) {
3587+
if (Options.IsNonAccessing || Options.ForGuaranteedReturn ||
3588+
Options.ForGuaranteedAddressReturn) {
35883589
enforcement = std::nullopt;
35893590
} else if (Storage->getDeclContext()->isLocalContext()) {
35903591
enforcement = SGF.getUnknownEnforcement(Storage);

0 commit comments

Comments
 (0)