Skip to content

Commit 4c7da4e

Browse files
committed
load => loadUnaligned
This is the potential source of a crash on x86_64 using the rebranch branch of Swift. rdar://115675736
1 parent 121c607 commit 4c7da4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/PackagePlugin/Plugin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ internal struct MessageConnection<TX,RX> where TX: Encodable, RX: Decodable {
303303
}
304304

305305
// Decode the count.
306-
let count = header.withUnsafeBytes{ $0.load(as: UInt64.self).littleEndian }
306+
let count = header.withUnsafeBytes{ $0.loadUnaligned(as: UInt64.self).littleEndian }
307307
guard count >= 2 else {
308308
throw PluginMessageError.invalidPayloadSize
309309
}

0 commit comments

Comments
 (0)