Skip to content

Commit

Permalink
Hm, why aren’t we detecting the broken stdlib on CI?
Browse files Browse the repository at this point in the history
  • Loading branch information
lorentey committed Oct 10, 2022
1 parent 541bd53 commit 946cbe8
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ extension Array {
// SR-14663 only triggers on array values that are verbatim bridged
// from Objective-C, so it cannot ever trigger for element types
// that aren't verbatim bridged.
print("Not bridged")
return false
}

Expand All @@ -33,21 +34,26 @@ extension Array {
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
if #available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) {
// The OS is too new to be affected by this bug. (>= 5.5 stdlib)
print("Too new")
return false
}
// guard #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13, *) else {
// // The OS is too old to be affected by this bug. (< 5.1 stdlib)
// return false
// }
guard #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13, *) else {
// The OS is too old to be affected by this bug. (< 5.1 stdlib)
print("Too old")
return false
}
print("Affected")
return true
#else
// Assume that other platforms aren't affected.
print("Unknown platform")
return false
#endif

#else
// Platforms that don't have an Objective-C runtime don't have verbatim
// bridged array values, so the bug doesn't apply to them.
print("Non-ObjC platform")
return false
#endif
}
Expand Down

0 comments on commit 946cbe8

Please sign in to comment.