Fix test crash in swift-reflection-dump rdar://60966825 (#30737)

Return a 32-bit or 64-bit ptrauth mask appropriate for the target.  This should correct a crash when a 64-bit swift-reflection-dump executable was used to inspect a 32-bit target binary.

Resolves rdar://60966825
This commit is contained in:
tbkka
2020-03-31 15:14:52 -07:00
committed by GitHub
parent 3c8fde7885
commit efa1a01a5a

View File

@@ -478,9 +478,16 @@ public:
case DLQ_GetPtrAuthMask: {
// We don't try to sign pointers at all in our view of the object
// mapping.
auto result = static_cast<uintptr_t *>(outBuffer);
*result = (uintptr_t)~0ull;
return true;
if (wordSize == 4) {
auto result = static_cast<uint32_t *>(outBuffer);
*result = (uint32_t)~0ull;
return true;
} else if (wordSize == 8) {
auto result = static_cast<uint64_t *>(outBuffer);
*result = (uint64_t)~0ull;
return true;
}
return false;
}
case DLQ_GetObjCReservedLowBits: {
auto result = static_cast<uint8_t *>(outBuffer);