Skip to content

Commit 4165e12

Browse files
committed
SIL: Fix recent bug introduced into old style mangling of specializations
The format is "type conformances... '_'" for each substitutable generic parameter. I broke it so that it emits types for the substitutable parameters but conformances for all requirements in the signature. This changed the mangling of specializations where the function being specialized placed additional constraints on associated types, causing demangling failure in the pre-specialization whitelist code. This might fix <rdar://problem/30932656>.
1 parent 26461ad commit 4165e12

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)