Skip to content

Commit 23ab6ab

Browse files
authored
Merge pull request #15093 from gottesmm/pr-e4723efd0cbe9753d85f4f6e30ab35a614063c19
2 parents 181595c + 672ea05 commit 23ab6ab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/SILGen/SILGenThunk.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ void SILGenFunction::emitCurryThunk(SILDeclRef thunk) {
148148
(void) fd;
149149
}
150150

151+
Scope S(*this, vd);
152+
151153
auto selfTy = vd->getInterfaceType()->castTo<AnyFunctionType>()
152154
->getInput();
153155
selfTy = vd->getInnermostDeclContext()->mapTypeIntoContext(selfTy);
@@ -185,6 +187,7 @@ void SILGenFunction::emitCurryThunk(SILDeclRef thunk) {
185187
emitCanonicalFunctionThunk(vd, toClosure, closureFnTy, resultFnTy);
186188
}
187189
}
190+
toClosure = S.popPreservingValue(toClosure);
188191
B.createReturn(ImplicitReturnLocation::getImplicitReturnLoc(vd), toClosure);
189192
}
190193

0 commit comments

Comments
 (0)