Skip to content

Commit 69d6781

Browse files
committed
Update utility to allow end_borrow on addresses which have OwnershipKind::None
1 parent 9ce2681 commit 69d6781

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/swift/SIL/SILBuilder.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,8 @@ class SILBuilder {
774774
}
775775

776776
void emitEndBorrowOperation(SILLocation loc, SILValue v) {
777-
if (!hasOwnership() || v->getOwnershipKind() == OwnershipKind::None)
777+
if (!hasOwnership() || (!v->getType().isAddress() &&
778+
v->getOwnershipKind() == OwnershipKind::None))
778779
return;
779780
createEndBorrow(loc, v);
780781
}

0 commit comments

Comments
 (0)