Skip to content

Commit ea6e3c9

Browse files
committed
ASTMangler: make sure to mangle canonical replacement types of substitution maps
When mangling types, it's expected that the type is canonical. Except if mangling for debug info. Fixes a crash.
1 parent 272fd22 commit ea6e3c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/AST/ASTMangler.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1968,7 +1968,11 @@ void ASTMangler::appendFlatGenericArgs(SubstitutionMap subs,
19681968
for (auto replacement : subs.getReplacementTypes()) {
19691969
if (replacement->hasArchetype())
19701970
replacement = replacement->mapTypeOutOfContext();
1971-
appendType(replacement, sig, forDecl);
1971+
if (DWARFMangling) {
1972+
appendType(replacement, sig, forDecl);
1973+
} else {
1974+
appendType(replacement->getCanonicalType(), sig, forDecl);
1975+
}
19721976
}
19731977
}
19741978

0 commit comments

Comments
 (0)