Skip to content

Commit 168986b

Browse files
committed
SIL: fix BorrowedValue initializer for non-guaranteed function args
1 parent b1dbb65 commit 168986b

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
@@ -288,7 +288,8 @@ enum BeginBorrowValue {
288288
switch value {
289289
case let bbi as BeginBorrowInst: self = .beginBorrow(bbi)
290290
case let lbi as LoadBorrowInst: self = .loadBorrow(lbi)
291-
case let arg as FunctionArgument: self = .functionArgument(arg)
291+
case let arg as FunctionArgument where arg.ownership == .guaranteed:
292+
self = .functionArgument(arg)
292293
case let arg as Argument where arg.isReborrow:
293294
self = .reborrow(Phi(arg)!)
294295
default:

0 commit comments

Comments
 (0)