Skip to content

Commit 0a254b4

Browse files
authored
Merge pull request #68939 from mikeash/reflectioncontext-data-auth-segments-5.10
[5.10][Reflection] Look for __AUTH segments as well as __DATA segments.
2 parents a6a8a4b + 83c3202 commit 0a254b4

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
@@ -371,12 +371,13 @@ class ReflectionContext
371371
if (!CmdBuf)
372372
return false;
373373
auto CmdHdr = reinterpret_cast<typename T::SegmentCmd *>(CmdBuf.get());
374-
// Look for any segment name starting with __DATA.
375-
if (strncmp(CmdHdr->segname, "__DATA", 6) == 0) {
374+
// Look for any segment name starting with __DATA or __AUTH.
375+
if (strncmp(CmdHdr->segname, "__DATA", 6) == 0 ||
376+
strncmp(CmdHdr->segname, "__AUTH", 6) == 0) {
376377
auto DataSegmentStart = Slide + CmdHdr->vmaddr;
377378
auto DataSegmentEnd = DataSegmentStart + CmdHdr->vmsize;
378379
assert(DataSegmentStart > ImageStart.getAddressData() &&
379-
"invalid range for __DATA");
380+
"invalid range for __DATA/__AUTH");
380381
dataRanges.push_back(std::make_tuple(RemoteAddress(DataSegmentStart),
381382
RemoteAddress(DataSegmentEnd)));
382383
}

0 commit comments

Comments
 (0)