Skip to content

Commit 6a26503

Browse files
committed
[swift-inspect] Again: Fix integer type mismatch on watchOS build.
Redo Mike's changes which were reverted: Convert integers to to `swift_reflection_ptr_t` instead of `UInt64` since watchOS uses `UInt` as its pointer type. rdar://118458631
1 parent 4fe3798 commit 6a26503

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
@@ -114,10 +114,10 @@ internal struct DumpGenericMetadata: ParsableCommand {
114114
? [swift_reflection_ptr_t:[swift_reflection_ptr_t]]()
115115
: try process.context.allocationStacks
116116

117-
let generics: [Metadata] = allocations.compactMap { allocation in
117+
let generics: [Metadata] = allocations.compactMap { allocation -> Metadata? in
118118
let pointer = swift_reflection_allocationMetadataPointer(process.context, allocation)
119119
if pointer == 0 { return nil }
120-
let allocation = allocations.last(where: { pointer >= $0.ptr && pointer < $0.ptr + UInt64($0.size) })
120+
let allocation = allocations.last(where: { pointer >= $0.ptr && pointer < $0.ptr + swift_reflection_ptr_t($0.size) })
121121
let garbage = (allocation == nil && swift_reflection_ownsAddressStrict(process.context, UInt(pointer)) == 0)
122122
var currentBacktrace: String?
123123
if let style = backtraceOptions.style, let allocation, let stack = stacks[allocation.ptr] {

0 commit comments

Comments
 (0)