pookjw
(Jinwoo Kim)
January 22, 2025, 4:28pm
1
I built swift-reflection-dump
using swift-6.0.3-RELEASE to dump a SwiftUICore binary, but I'm getting an 'Invalid typeref' error from output. How can I resolve this?
/Volumes/Untitled/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin/swift-reflection-dump --arch=arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22C150/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 18.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore > ./SwiftUICore.txt
__C.CGVector
------------
dx: with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
- TypeDecoder.h:1499: Node kind 221 "u¡
" - unexpected kind
dy: with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
__C.CGAffineTransform
---------------------
a: with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
- TypeDecoder.h:1499: Node kind 221 "u¡
" - unexpected kind
b: with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
- TypeDecoder.h:1499: Node kind 221 "u¡
" - unexpected kind
c: with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
- TypeDecoder.h:1499: Node kind 221 "u¡
" - unexpected kind
d: with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
- TypeDecoder.h:1499: Node kind 221 "u¡
" - unexpected kind
tx: with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
- TypeDecoder.h:1499: Node kind 221 "u¡
" - unexpected kind
ty: with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
pookjw
(Jinwoo Kim)
January 23, 2025, 1:26am
2
@Kyle-Ye Any idea about this? Thanks.
Kyle-Ye
(Kyle)
January 23, 2025, 2:32am
3
Looks like you are encountering an error when decoding the CGAffineTransform
and CGVector
's property type
genericArgs.emplace_back(genericArgsBuf.data() + start,
end - start);
}
return Builder.resolveOpaqueType(descriptor, genericArgs, ordinal);
}
// TODO: Handle OpaqueReturnType, when we're in the middle of reconstructing
// the defining decl
default:
return MAKE_NODE_TYPE_ERROR0(Node, "unexpected kind");
}
}
private:
template <typename Fn>
std::optional<TypeLookupError>
decodeTypeSequenceElement(Demangle::NodePointer node, unsigned depth,
Fn resultCallback) {
if (node->getKind() == NodeKind::Type)
node = node->getChild(0);
And TypeDecoder does not handle the 221 case here.
I'm not familiar with the logic too. Maybe you can try to add another case logic here to just ignore the 221 Node kind (Seems to be SpecializationPassID
)?
1 Like
Kyle-Ye
(Kyle)
January 23, 2025, 2:33am
4
pookjw:
SwiftUICore
Also what is the corresponding SDK's SwiftUICore you are trying to dump? iOS 18.0 Beta X or iOS 18.X?
pookjw
(Jinwoo Kim)
January 23, 2025, 2:47am
5
Also what is the corresponding SDK's SwiftUICore you are trying to dump? iOS 18.0 Beta X or iOS 18.X?
I am trying with iOS 18.2 Simulator.
pookjw
(Jinwoo Kim)
January 23, 2025, 2:51am
6
Looks like you are encountering an error when decoding the CGAffineTransform and CGVector's property type
And TypeDecoder does not handle the 221 case here.
I'm not familiar with the logic too. Maybe you can try to add another case logic here to just ignore the 221 Node kind (Seems to be SpecializationPassID)?
Thanks. It seems that TypeDecoder.decodeMangledType
doesn't handle all node types. This error occurs because NodeKind::Suffix
is not handled. I'll look into it.
1 Like