Skip to content

Commit 0152595

Browse files
authored
fix the module map of main executable on darwin platforms
skip the __PAGEZERO segment when calculate image range
1 parent 7aabdb8 commit 0152595

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ void MemoryMappingLayout::DumpListOfModules(
433433
MemoryMappedSegmentData data;
434434
segment.data_ = &data;
435435
while (Next(&segment)) {
436-
if (segment.filename[0] == '\0') continue;
436+
// skip the __PAGEZERO segment, its vmsize is 0
437+
if (segment.filename[0] == '\0' || (segment.start == segment.end)) continue;
437438
LoadedModule *cur_module = nullptr;
438439
if (!modules->empty() &&
439440
0 == internal_strcmp(segment.filename, modules->back().full_name())) {

0 commit comments

Comments
 (0)