Skip to content

Commit 9477ed2

Browse files
committed
[swift-inspect] Fix integer type mismatch on watchOS build.
Convert integers to to `swift_reflection_ptr_t` instead of `UInt64` since watchOS uses `UInt` as its pointer type. rdar://118458631
1 parent 412a828 commit 9477ed2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/swift-inspect/Sources/swift-inspect/Operations/DumpGenericMetadata.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ internal struct DumpGenericMetadata: ParsableCommand {
4141
let allocations: [swift_metadata_allocation_t] =
4242
try process.context.allocations.sorted()
4343

44-
let generics: [Metadata] = allocations.compactMap { allocation in
44+
let generics: [Metadata] = allocations.compactMap { allocation -> Metadata? in
4545
let pointer = swift_reflection_allocationMetadataPointer(process.context, allocation)
4646
if pointer == 0 { return nil }
4747

4848
return Metadata(ptr: pointer,
49-
allocation: allocations.last(where: { pointer >= $0.ptr && pointer < $0.ptr + UInt64($0.size) }),
49+
allocation: allocations.last(where: { pointer >= $0.ptr && pointer < $0.ptr + swift_reflection_ptr_t($0.size) }),
5050
name: (process.context.name(type: pointer, mangled: genericMetadataOptions.mangled) ?? "<unknown>"),
5151
isArrayOfClass: process.context.isArrayOfClass(pointer))
5252
}

0 commit comments

Comments
 (0)