Skip to content

Commit 83c3202

Browse files
committed
[5.10][Reflection] Look for __AUTH segments as well as __DATA segments.
Some data is stored in __AUTH, which we need to add to our list of data segments so that `ownsAddress` works correctly. rdar://116363531 (cherry picked from commit 238d1cd)
1 parent 99646c3 commit 83c3202

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)