Skip to content

Commit b1601a9

Browse files
committed
Fix ApplySite.originalParameter(of:).
1 parent 79fe8ba commit b1601a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

SwiftCompilerSources/Sources/SIL/ApplySite.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ public struct ApplyOperandConventions : Collection {
6969
guard let argIdx = calleeArgumentIndex(of: operand) else {
7070
return nil
7171
}
72-
guard argIdx >= calleeArgumentConventions.firstParameterIndex else {
72+
let firstParamIdx = calleeArgumentConventions.firstParameterIndex
73+
guard argIdx >= firstParamIdx else {
7374
return nil
7475
}
75-
return calleeArgumentConventions.originalParameters[argIdx]
76+
return calleeArgumentConventions.originalParameters[argIdx - firstParamIdx]
7677
}
7778

7879
public var firstParameterOperandIndex: Int {

0 commit comments

Comments
 (0)