File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -745,6 +745,7 @@ class SILBuilder {
745
745
746
746
BeginBorrowInst *createBeginBorrow (SILLocation Loc, SILValue LV,
747
747
bool isLexical = false ) {
748
+ assert (getFunction ().hasOwnership ());
748
749
assert (!LV->getType ().isAddress ());
749
750
return insert (new (getModule ())
750
751
BeginBorrowInst (getSILDebugLocation (Loc), LV, isLexical));
Original file line number Diff line number Diff line change @@ -171,7 +171,8 @@ class BeginApplySite {
171
171
// which require an @guaranteed operand into which we'd be attempting to
172
172
// substitute an @owned operand.
173
173
if (calleeYields[i]->getOwnershipKind () == OwnershipKind::Owned &&
174
- !yield->getOperandRef (i).isConsuming ()) {
174
+ !yield->getOperandRef (i).isConsuming () &&
175
+ Builder->getFunction ().hasOwnership ()) {
175
176
auto *bbi = Builder->createBeginBorrow (Loc, remappedYield);
176
177
guaranteedYields.push_back (bbi);
177
178
remappedYield = bbi;
You can’t perform that action at this time.
0 commit comments