Skip to content

Commit fb3972c

Browse files
committed
AST: Don't crash when computing identifier for an invalid extension.
1 parent de4370b commit fb3972c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/AST/FrontendSourceFileDepGraphFactory.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ static std::string identifierForContext(const DeclContext *DC) {
6767

6868
const auto *ext = cast<ExtensionDecl>(DC);
6969
auto fp = ext->getBodyFingerprint().value_or(Fingerprint::ZERO());
70-
auto typeStr = Mangler.mangleTypeAsContextUSR(ext->getExtendedNominal());
70+
const auto *nominal = ext->getExtendedNominal();
71+
auto typeStr = nominal ? Mangler.mangleTypeAsContextUSR(nominal) : "";
7172
return (typeStr + "@" + fp.getRawValue()).str();
7273
}
7374

0 commit comments

Comments
 (0)