Merge pull request #39531 from jckarter/argument-reabstraction-ownership

SILGen: Ensure +1 before reabstracting closure BB args.
This commit is contained in:
Joe Groff
2021-10-01 09:56:01 -07:00
committed by GitHub
2 changed files with 13 additions and 2 deletions

View File

@@ -106,9 +106,9 @@ public:
argType = argType.getObjectType();
}
if (argType != paramType) {
if (argType.getASTType() != paramType.getASTType()) {
// Reabstract the value if necessary.
mv = SGF.emitOrigToSubstValue(loc, mv, orig, t);
mv = SGF.emitOrigToSubstValue(loc, mv.ensurePlusOne(SGF, loc), orig, t);
}
// If the value is a (possibly optional) ObjC block passed into the entry