We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c440040 commit 2e433d4Copy full SHA for 2e433d4
lib/SILGen/SILGenApply.cpp
@@ -1687,9 +1687,12 @@ static SILValue emitRawApply(SILGenFunction &SGF,
1687
ArrayRef<SILValue> indirectResultAddrs) {
1688
SILFunctionConventions substFnConv(substFnType, SGF.SGM.M);
1689
// Get the callee value.
1690
- SILValue fnValue = substFnType->isCalleeConsumed()
1691
- ? fn.forward(SGF)
1692
- : fn.borrow(SGF, loc).getValue();
+ bool isConsumed = substFnType->isCalleeConsumed();
+ bool isUnowned =
+ substFnType->getCalleeConvention() == ParameterConvention::Direct_Unowned;
1693
+ SILValue fnValue =
1694
+ isUnowned ? fn.getValue()
1695
+ : isConsumed ? fn.forward(SGF) : fn.borrow(SGF, loc).getValue();
1696
1697
SmallVector<SILValue, 4> argValues;
1698
0 commit comments