Skip to content

Commit 773e107

Browse files
authored
Merge pull request #310 from p-x9/feature/fix-objc-header-info-cache-resolution
Fix ObjC header info lookup for subcaches
2 parents c7ffcf1 + 484a825 commit 773e107

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Sources/MachOKit/Model/DyldCache/ObjCOptimization/ObjCHeaderOptimizationRO.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,14 @@ extension ObjCHeaderOptimizationROProtocol {
204204
public func headerInfo(
205205
in cache: DyldCache, for machO: MachOFile
206206
) -> HeaderInfo? {
207-
guard machO.headerStartOffsetInCache > 0 else {
207+
guard machO.headerStartOffsetInCache > 0,
208+
let cacheForMachO = machO.cache else {
208209
return nil
209210
}
210211
return headerInfos(in: cache)?
211212
.first(
212213
where: {
213-
guard let offset = $0.resolvedMachOHeaderOffset(in: cache) else {
214+
guard let offset = $0.resolvedMachOHeaderOffset(in: cacheForMachO) else {
214215
return false
215216
}
216217
return machO.headerStartOffsetInCache == offset

0 commit comments

Comments
 (0)