Skip to content

Commit c082096

Browse files
authored
Merge pull request #7993 from slavapestov/fix-specialization-mangling
SIL: Fix recent bug introduced into old style mangling of specializations
2 parents 26461ad + 4165e12 commit c082096

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/SIL/Mangle.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ void GenericSpecializationMangler::mangleSpecialization() {
5353
auto SubMap = Sig->getSubstitutionMap(Subs);
5454
Sig->enumeratePairedRequirements(
5555
[&](Type depTy, ArrayRef<Requirement> reqts) {
56-
if (depTy->is<GenericTypeParamType>())
57-
M.mangleType(depTy.subst(SubMap)->getCanonicalType(), 0);
56+
if (!depTy->is<GenericTypeParamType>())
57+
return false;
58+
59+
M.mangleType(depTy.subst(SubMap)->getCanonicalType(), 0);
5860

5961
for (auto reqt : reqts) {
6062
auto conformance = SubMap.lookupConformance(

0 commit comments

Comments
 (0)