Skip to content

Commit 298458a

Browse files
committed
[Runtime demangler] Mangled extension context doesn’t always have Type.
The demangle tree for an extension type context doesn’t always have a Type node wrapping it, and that’s okay.
1 parent 3f79cb9 commit 298458a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/runtime/Demangle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ swift::_buildDemanglingForContext(const ContextDescriptor *context,
8787
auto extension = llvm::cast<ExtensionContextDescriptor>(component);
8888
// Demangle the extension self type.
8989
auto selfType = Dem.demangleType(extension->getMangledExtendedContext());
90-
assert(selfType->getKind() == Node::Kind::Type);
91-
selfType = selfType->getChild(0);
90+
if (selfType->getKind() == Node::Kind::Type)
91+
selfType = selfType->getChild(0);
9292

9393
// Substitute in the generic arguments.
9494
// TODO: This kludge only kinda works if there are no same-type

0 commit comments

Comments
 (0)