mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix specialization of class method calls in embedded swift.
Unlike in regular swift, The class_method instruction references the specialized version of a class method. This must be handled in ReabstractionInfo: it needs to work without a concrete callee SIL function. Also, the SILVerifier must handle the case that a class_method instruction references a specialized method.
This commit is contained in:
@@ -204,7 +204,7 @@ bool swift::specializeClassMethodInst(ClassMethodInst *cm) {
|
||||
SILType substitutedType =
|
||||
funcTy.substGenericArgs(m, subs, TypeExpansionContext::minimal());
|
||||
|
||||
ReabstractionInfo reInfo(substitutedType.getAs<SILFunctionType>(), m);
|
||||
ReabstractionInfo reInfo(substitutedType.getAs<SILFunctionType>(), cm->getMember(), m);
|
||||
reInfo.createSubstitutedAndSpecializedTypes();
|
||||
CanSILFunctionType finalFuncTy = reInfo.getSpecializedType();
|
||||
SILType finalSILTy = SILType::getPrimitiveObjectType(finalFuncTy);
|
||||
|
||||
Reference in New Issue
Block a user