Skip to content

Commit

Permalink
Make sure segment's offset is not null when refreshing cache
Browse files Browse the repository at this point in the history
Related to #1130
  • Loading branch information
romainthomas committed Dec 9, 2024
1 parent bd6f627 commit f1b3586
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/MachO/Binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2336,6 +2336,9 @@ ExportInfo* Binary::add_exported_function(uint64_t address, const std::string& n
void Binary::refresh_seg_offset() {
offset_seg_.clear();
for (SegmentCommand* segment : segments_) {
if (segment->file_offset_ == 0) {
continue;
}
offset_seg_[segment->file_offset()] = segment;
}
}
Expand Down

0 comments on commit f1b3586

Please sign in to comment.