Skip to content

Commit 9f76c19

Browse files
authored
Merge pull request #68938 from mikeash/reflectioncontext-data-auth-segments
[Reflection] Look for __AUTH segments as well as __DATA segments.
2 parents 3d8607a + 238d1cd commit 9f76c19

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

include/swift/RemoteInspection/ReflectionContext.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,13 @@ class ReflectionContext
369369
if (!CmdBuf)
370370
return false;
371371
auto CmdHdr = reinterpret_cast<typename T::SegmentCmd *>(CmdBuf.get());
372-
// Look for any segment name starting with __DATA.
373-
if (strncmp(CmdHdr->segname, "__DATA", 6) == 0) {
372+
// Look for any segment name starting with __DATA or __AUTH.
373+
if (strncmp(CmdHdr->segname, "__DATA", 6) == 0 ||
374+
strncmp(CmdHdr->segname, "__AUTH", 6) == 0) {
374375
auto DataSegmentStart = Slide + CmdHdr->vmaddr;
375376
auto DataSegmentEnd = DataSegmentStart + CmdHdr->vmsize;
376377
assert(DataSegmentStart > ImageStart.getAddressData() &&
377-
"invalid range for __DATA");
378+
"invalid range for __DATA/__AUTH");
378379
dataRanges.push_back(std::make_tuple(RemoteAddress(DataSegmentStart),
379380
RemoteAddress(DataSegmentEnd)));
380381
}

0 commit comments

Comments
 (0)