File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -5482,6 +5482,9 @@ ManagedValue SILGenFunction::applyBorrowMutateAccessor(
54825482 if (fn.getFunction ()->getConventions ().hasGuaranteedResult ()) {
54835483 auto selfArg = args.back ().getValue ();
54845484 if (isa<LoadBorrowInst>(selfArg)) {
5485+ // unchecked_ownership is used to silence the ownership verifier for
5486+ // returning a value produced within a load_borrow scope. SILGenCleanup
5487+ // eliminates it and introduces return_borrow appropriately.
54855488 rawResult = B.createUncheckedOwnership (loc, rawResult);
54865489 }
54875490 }
Original file line number Diff line number Diff line change @@ -720,6 +720,9 @@ bool SILGenFunction::emitBorrowOrMutateAccessorResult(
720720 assert (F.getConventions ().hasGuaranteedResult ());
721721 auto regularLoc = RegularLocation::getAutoGeneratedLocation ();
722722 auto load = B.createLoadBorrow (regularLoc, guaranteedAddress).getValue ();
723+ // unchecked_ownership is used to silence the ownership verifier for
724+ // returning a value produced within a load_borrow scope. SILGenCleanup
725+ // eliminates it and introduces return_borrow appropriately.
723726 return B.createUncheckedOwnership (regularLoc, load);
724727 };
725728
You can’t perform that action at this time.
0 commit comments