mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Fix crash in SubstitutionMap::dump() with empty SubstitutionMap
The SubstitutionMap type has a "null value" where there's no generic signature and no entries. There's nothing to dump in this case.
This commit is contained in:
@@ -398,8 +398,13 @@ void SubstitutionMap::verify() const {
|
||||
}
|
||||
|
||||
void SubstitutionMap::dump(llvm::raw_ostream &out) const {
|
||||
auto *genericSig = getGenericSignature();
|
||||
if (genericSig == nullptr) {
|
||||
out << "Empty substitution map\n";
|
||||
return;
|
||||
}
|
||||
out << "Generic signature: ";
|
||||
getGenericSignature()->print(out);
|
||||
genericSig->print(out);
|
||||
out << "\n";
|
||||
out << "Substitutions:\n";
|
||||
for (const auto &sub : subMap) {
|
||||
|
||||
Reference in New Issue
Block a user