Skip to content

Commit 406afc7

Browse files
committed
SwiftCompilerSources: Fix InteriorUseWalker with visitInnerUses.
Add support to all kinds of borrowing instructions so we visit all their inner uses.
1 parent 8decfa4 commit 406afc7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/OwnershipLiveness.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,9 @@ extension InteriorUseWalker: OwnershipUseVisitor {
608608
if handleInner(borrowed: beginBorrow.value) == .abortWalk {
609609
return .abortWalk
610610
}
611-
if visitInnerUses {
612-
return visitAllUses(of: beginBorrow.value)
613-
}
611+
}
612+
if visitInnerUses, let innerValue = borrowInst.innerValue {
613+
return visitAllUses(of: innerValue)
614614
}
615615
return visitInnerBorrowUses(of: borrowInst, operand: operand)
616616
}

0 commit comments

Comments
 (0)