Skip to content

Commit 3f4e513

Browse files
committed
Setting the found estimated function lengths in the Mach-O file
1 parent 427d599 commit 3f4e513

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/parser/file/macho/machoFile.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,16 @@ static inline bool machoFile_parseFileImpl64(struct machoFile * self,
353353
}
354354
lc = (void *) lc + macho_maybeSwap(32, bitsReversed, lc->cmdsize);
355355
}
356+
357+
vector_iterate(pair_funcFile_t, &self->functions, {
358+
if (element->first.length != 0) continue;
359+
360+
uint64_t* address = vector_uint64_search(&self->functionStarts, &element->first.startAddress, &machoFile_uint64Compare);
361+
if (address != NULL && (size_t) (address - self->functionStarts.content) < self->functionStarts.count - 2) {
362+
element->first.length = *++address - element->first.startAddress;
363+
}
364+
})
365+
356366
return true;
357367
}
358368

0 commit comments

Comments
 (0)