File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -2649,10 +2649,17 @@ void ASTMangler::appendDependentProtocolConformance(
2649
2649
void ASTMangler::appendConcreteProtocolConformance (
2650
2650
const ProtocolConformance *conformance) {
2651
2651
auto module = conformance->getDeclContext ()->getParentModule ();
2652
- if (!CurGenericSignature && conformance->getGenericSignature ()) {
2653
- CurGenericSignature =
2654
- conformance->getGenericSignature ()->getCanonicalSignature ();
2655
- }
2652
+
2653
+ // It's possible that we might not have a generic signature here to get
2654
+ // the conformance access path (for example, when mangling types for
2655
+ // debugger). In that case, we can use the generic signature of the
2656
+ // conformance (if it's present).
2657
+ auto conformanceSig = conformance->getGenericSignature ();
2658
+ auto shouldUseConformanceSig = !CurGenericSignature && conformanceSig;
2659
+ llvm::SaveAndRestore<CanGenericSignature> savedSignature (
2660
+ CurGenericSignature, shouldUseConformanceSig
2661
+ ? conformanceSig->getCanonicalSignature ()
2662
+ : CurGenericSignature);
2656
2663
2657
2664
// Conforming type.
2658
2665
Type conformingType = conformance->getType ();
You can’t perform that action at this time.
0 commit comments