[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.
diff --git a/stdlib/public/runtime/Demangle.cpp b/stdlib/public/runtime/Demangle.cpp
index 4d8f8ce..8f38a52 100644
--- a/stdlib/public/runtime/Demangle.cpp
+++ b/stdlib/public/runtime/Demangle.cpp
@@ -87,8 +87,8 @@
auto extension = llvm::cast<ExtensionContextDescriptor>(component);
// Demangle the extension self type.
auto selfType = Dem.demangleType(extension->getMangledExtendedContext());
- assert(selfType->getKind() == Node::Kind::Type);
- selfType = selfType->getChild(0);
+ if (selfType->getKind() == Node::Kind::Type)
+ selfType = selfType->getChild(0);
// Substitute in the generic arguments.
// TODO: This kludge only kinda works if there are no same-type