Skip to content

Commit 4f8556d

Browse files
authored
Merge pull request swiftlang#35031 from gottesmm/pr-7b80c07cdbdd273eed31ca1f3a6e3c1b8e8cdf50
[ownership] Do not insert an end_borrow when calling emitEndBorrowOperation on a value with OwnershipKind::None.
2 parents 7d11b0f + ea0c135 commit 4f8556d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/swift/SIL/SILBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ class SILBuilder {
782782
}
783783

784784
void emitEndBorrowOperation(SILLocation loc, SILValue v) {
785-
if (!hasOwnership())
785+
if (!hasOwnership() || v.getOwnershipKind() == OwnershipKind::None)
786786
return;
787787
createEndBorrow(loc, v);
788788
}

0 commit comments

Comments
 (0)