mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
ArrayElementValuePropagation: fix a wrong substituted function type for the generated reserveCapacity function call
This commit is contained in:
@@ -734,7 +734,8 @@ bool swift::ArraySemanticsCall::replaceByAppendingValues(
|
||||
Builder.createIntegerLiteral(Loc, BuiltinIntTy, Vals.size());
|
||||
StructInst *Capacity = Builder.createStruct(Loc,
|
||||
SILType::getPrimitiveObjectType(CanType(IntType)), {CapacityLiteral});
|
||||
Builder.createApply(Loc, ReserveFnRef, FnTy.substGenericArgs(M, Subs),
|
||||
Builder.createApply(Loc, ReserveFnRef,
|
||||
ReserveFnRef->getType().substGenericArgs(M, Subs),
|
||||
ReserveFnTy->getAllResultsType(), Subs,
|
||||
{Capacity, ArrRef}, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user