@@ -6683,10 +6683,12 @@ void irgen::emitAsyncReturn(IRGenFunction &IGF, AsyncContextLayout &asyncLayout,
6683
6683
if (combinedTy->isVoidTy ()) {
6684
6684
assert (result.empty () && " Unexpected result values" );
6685
6685
} else {
6686
+ Explosion native = nativeSchema.mapIntoNative (
6687
+ IGM, IGF, result, funcResultTypeInContext, /* isOutlined*/ false );
6686
6688
if (auto *structTy = dyn_cast<llvm::StructType>(combinedTy)) {
6687
6689
llvm::Value *nativeAgg = llvm::UndefValue::get (structTy);
6688
- for (unsigned i = 0 , e = result .size (); i < e; ++i) {
6689
- llvm::Value *elt = result .claimNext ();
6690
+ for (unsigned i = 0 , e = native .size (); i < e; ++i) {
6691
+ llvm::Value *elt = native .claimNext ();
6690
6692
auto *nativeTy = structTy->getElementType (i);
6691
6693
elt = convertForDirectError (IGF, elt, nativeTy,
6692
6694
/* forExtraction*/ false );
@@ -6697,9 +6699,9 @@ void irgen::emitAsyncReturn(IRGenFunction &IGF, AsyncContextLayout &asyncLayout,
6697
6699
while (!out.empty ()) {
6698
6700
nativeResultsStorage.push_back (out.claimNext ());
6699
6701
}
6700
- } else if (!result .empty ()) {
6702
+ } else if (!native .empty ()) {
6701
6703
auto *converted = convertForDirectError (
6702
- IGF, result .claimNext (), combinedTy, /* forExtraction*/ false );
6704
+ IGF, native .claimNext (), combinedTy, /* forExtraction*/ false );
6703
6705
nativeResultsStorage.push_back (converted);
6704
6706
} else {
6705
6707
nativeResultsStorage.push_back (llvm::UndefValue::get (combinedTy));
0 commit comments