Skip to content

Commit 2196c3d

Browse files
authored
Explicitly load unaligned data in test (#875)
rdar://125770540
1 parent 0d8ccb7 commit 2196c3d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tests/SwiftDocCTests/Utility/LMDBTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,13 @@ struct RawStub: LMDBData, Equatable, Codable {
313313

314314
var cursor: Int = 0
315315
let length = MemoryLayout<Int64>.stride
316-
let id = d[cursor..<cursor + length].withUnsafeBytes { $0.load(as: Int64.self) }
316+
let id = d[cursor..<cursor + length].withUnsafeBytes { $0.loadUnaligned(as: Int64.self) }
317317
cursor += length
318318

319-
let titleLength = d[cursor..<cursor + length].withUnsafeBytes{ $0.load(as: Int64.self) }
319+
let titleLength = d[cursor..<cursor + length].withUnsafeBytes{ $0.loadUnaligned(as: Int64.self) }
320320
cursor += length
321321

322-
let typeLength = d[cursor..<cursor + length].withUnsafeBytes { $0.load(as: Int64.self) }
322+
let typeLength = d[cursor..<cursor + length].withUnsafeBytes { $0.loadUnaligned(as: Int64.self) }
323323
cursor += length
324324

325325
let titleData = d[cursor..<cursor + Int(titleLength)]

0 commit comments

Comments
 (0)