mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Correctly terminate inner coroutine for custom vjps
This commit is contained in:
@@ -5395,6 +5395,7 @@ public:
|
||||
if (forUnwind && CanUnwind) {
|
||||
SGF.B.createAbortApply(l, ApplyToken);
|
||||
} else {
|
||||
// TODO: This is not correct when coroutine has a normal result
|
||||
SGF.B.createEndApply(l, ApplyToken,
|
||||
SILType::getEmptyTupleType(SGF.getASTContext()));
|
||||
}
|
||||
|
||||
@@ -6486,7 +6486,7 @@ ManagedValue SILGenFunction::getThunkedAutoDiffLinearMap(
|
||||
SILType substFnType = linearMapArg->getType().substGenericArgs(
|
||||
thunkSGF.getModule(), subs, thunk->getTypeExpansionContext());
|
||||
auto tokenAndCleanups = thunkSGF.emitBeginApplyWithRethrow(
|
||||
loc, linearMapArg, substFnType,
|
||||
loc, linearMapArg, substFnType, true,
|
||||
SubstitutionMap(), arguments, yields);
|
||||
auto token = std::get<0>(tokenAndCleanups);
|
||||
auto abortCleanup = std::get<1>(tokenAndCleanups);
|
||||
@@ -6762,7 +6762,7 @@ SILFunction *SILGenModule::getOrCreateCustomDerivativeThunk(
|
||||
SmallVector<SILValue, 1> yields;
|
||||
// Start inner coroutine execution till the suspend point
|
||||
auto tokenAndCleanups = thunkSGF.emitBeginApplyWithRethrow(
|
||||
loc, fnRef, substFnType /*fnRef->getType()*/,
|
||||
loc, fnRef, substFnType /*fnRef->getType()*/, true,
|
||||
subs, arguments, yields);
|
||||
auto token = std::get<0>(tokenAndCleanups);
|
||||
auto abortCleanup = std::get<1>(tokenAndCleanups);
|
||||
|
||||
Reference in New Issue
Block a user