Skip to content

Commit 2c36401

Browse files
committed
SIL: fix BorrowedValue initializer for non-guaranteed function args
1 parent 667d5f8 commit 2c36401

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/BorrowUtils.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ enum BeginBorrowValue {
293293
switch value {
294294
case let bbi as BeginBorrowInst: self = .beginBorrow(bbi)
295295
case let lbi as LoadBorrowInst: self = .loadBorrow(lbi)
296-
case let arg as FunctionArgument: self = .functionArgument(arg)
296+
case let arg as FunctionArgument where arg.ownership == .guaranteed:
297+
self = .functionArgument(arg)
297298
case let arg as Argument where arg.isReborrow:
298299
self = .reborrow(Phi(arg)!)
299300
default:

0 commit comments

Comments
 (0)