Skip to content

Commit 8d5dbe8

Browse files
authored
Need to initialize os_unfair_lock guarding the fallback event handler (#1478)
Prior to this fix, we didn't have an explicit init which could lead to garbage values. Resolves rdar://167861118 ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent 100542a commit 8d5dbe8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Sources/_TestingInterop/FallbackEventHandler.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ private nonisolated(unsafe) let _fallbackEventHandler = {
2222
minimumCapacity: 1,
2323
makingHeaderWith: { _ in nil }
2424
)
25-
result.withUnsafeMutablePointerToHeader { $0.initialize(to: nil) }
25+
result.withUnsafeMutablePointerToElements { lock in
26+
lock.initialize(to: .init())
27+
}
2628
return result
2729
}()
2830
#else

0 commit comments

Comments
 (0)