StringOptimization: fix a crash when constant folding the type name of an inner class

rdar://problem/66540633
This commit is contained in:
Erik Eckstein
2020-08-05 11:34:17 +02:00
parent 57d5c4d6ed
commit b8485d6d14
2 changed files with 21 additions and 2 deletions

View File

@@ -257,12 +257,16 @@ static bool containsProblematicNode(Demangle::Node *node, bool qualified) {
if (qualified)
return true;
break;
case Demangle::Node::Kind::Class:
case Demangle::Node::Kind::Class: {
// ObjC class names are not derived from the mangling but from the
// ObjC runtime. We cannot constant fold this.
if (node->getChild(0)->getText() == "__C")
Demangle::Node *context = node->getChild(0);
if (context->getKind() == Demangle::Node::Kind::Module &&
context->getText() == "__C") {
return true;
}
break;
}
default:
break;
}