Skip to content

Commit

Permalink
Merge pull request #77 from p-x9/fix/data-sequence-subscript
Browse files Browse the repository at this point in the history
Fix subscript for `DataSequence`
  • Loading branch information
p-x9 committed Apr 26, 2024
2 parents ac7b964 + 12ab91b commit e35e154
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/MachOKit/Util/Sequence/DataSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ extension DataSequence: Collection {
return data.withUnsafeBytes {
guard let baseAddress = $0.baseAddress else { fatalError() }
return baseAddress
.assumingMemoryBound(to: Element.self)
.advanced(by: position)
.load(as: Element.self)
.pointee
}
}
}
Expand Down

0 comments on commit e35e154

Please sign in to comment.