Skip to content

Commit df62235

Browse files
committed
SIL Verifier: avoid crashing for a missing borrowed-from - instead report an error
1 parent 5d5e607 commit df62235

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/Verifier.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ private struct MutatingUsesWalker : AddressDefUseWalker {
164164

165165
for use in startInst.uses {
166166
if let phi = Phi(using: use) {
167-
linearLiveranges.pushIfNotVisited(phi.borrowedFrom!)
167+
if let bf = phi.borrowedFrom {
168+
linearLiveranges.pushIfNotVisited(bf)
169+
} else {
170+
require(false, "missing borrowed-from for \(phi.value)")
171+
}
168172
}
169173
}
170174
}

0 commit comments

Comments
 (0)