Skip to content

Commit 33c2d9e

Browse files
authored
Add assertion failure on out of bounds access to explicit dependency tracker (#343)
1 parent b54602b commit 33c2d9e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift

+4
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ private struct GlobalExplicitDependencyTracker {
100100
assertionFailure("Unexpectedly found a regular job in 'plannedExplicitDependencyJobs'")
101101
continue
102102
}
103+
guard plannedExplicitDependencyJobs.indices.contains(index) else {
104+
assertionFailure("Unexpectedly found an out of bounds job index into 'plannedExplicitDependencyJobs'")
105+
continue
106+
}
103107
let job = plannedExplicitDependencyJobs[index]
104108
assert(job.key == key)
105109
jobs.append(job)

0 commit comments

Comments
 (0)