Skip to content

Commit

Permalink
[TSan] Work around a bug in TSan
Browse files Browse the repository at this point in the history
  • Loading branch information
karwa committed Oct 4, 2022
1 parent a8b7cdd commit a04b0e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/WebURL/IPAddress.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ internal protocol IPAddressParserCallback {
@usableFromInline
internal struct IgnoreIPAddressParserErrors: IPAddressParserCallback {

#if DEBUG
// TSan encounters internal errors when passing empty structs around 'inout'.
// See: https://github.com/apple/swift/issues/61073 and https://github.com/apple/swift/issues/56405
let _tsanBugWorkaround = true
#endif

@inlinable
internal init() {}

Expand Down
6 changes: 6 additions & 0 deletions Sources/WebURL/Parser/ValidationError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ internal protocol URLParserCallback {
@usableFromInline
internal struct IgnoreValidationErrors: URLParserCallback {

#if DEBUG
// TSan encounters internal errors when passing empty structs around 'inout'.
// See: https://github.com/apple/swift/issues/61073 and https://github.com/apple/swift/issues/56405
let _tsanBugWorkaround = true
#endif

@inlinable @inline(__always)
internal init() {}

Expand Down

0 comments on commit a04b0e5

Please sign in to comment.