File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -186,13 +186,21 @@ extension Triple {
186
186
187
187
/// Returns `true` if code compiled for `triple` can run on `self` value of ``Triple``.
188
188
public func isRuntimeCompatible( with triple: Triple ) -> Bool {
189
+ guard self != triple else {
190
+ return true
191
+ }
192
+
189
193
if
190
194
self . arch == triple. arch &&
191
195
self . vendor == triple. vendor &&
192
196
self . os == triple. os &&
193
- self . environment == triple. environment
197
+ self . environment == triple. environment,
198
+ // If either of the triples have no `osVersion` specified, we can't determine compatibility and will
199
+ // have to return `false`.
200
+ let selfOSVersion = self . osVersion,
201
+ let osVersion = triple. osVersion
194
202
{
195
- return self . osVersion >= triple . osVersion
203
+ return selfOSVersion >= osVersion
196
204
} else {
197
205
return false
198
206
}
You can’t perform that action at this time.
0 commit comments