Skip to content

Commit 63e3ee0

Browse files
authored
Mangling: Add another assert in mangleDependentGenericConformanceRequirement (#62324)
Ensure `ProtoOrClass` has children before calling `getFirstChild()`. rdar://102610500
1 parent 0aa39e3 commit 63e3ee0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/Demangling/Remangler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,7 @@ Remangler::mangleDependentGenericConformanceRequirement(Node *node,
980980
unsigned depth) {
981981
DEMANGLER_ASSERT(node->getNumChildren() == 2, node);
982982
Node *ProtoOrClass = node->getChild(1);
983+
DEMANGLER_ASSERT(ProtoOrClass->hasChildren(), ProtoOrClass);
983984
if (ProtoOrClass->getFirstChild()->getKind() == Node::Kind::Protocol) {
984985
RETURN_IF_ERROR(manglePureProtocol(ProtoOrClass, depth + 1));
985986
auto Mangling = mangleConstrainedType(node->getChild(0), depth + 1);

0 commit comments

Comments
 (0)