@@ -6683,10 +6683,12 @@ void irgen::emitAsyncReturn(IRGenFunction &IGF, AsyncContextLayout &asyncLayout,
66836683 if (combinedTy->isVoidTy ()) {
66846684 assert (result.empty () && " Unexpected result values" );
66856685 } else {
6686+ Explosion native = nativeSchema.mapIntoNative (
6687+ IGM, IGF, result, funcResultTypeInContext, /* isOutlined*/ false );
66866688 if (auto *structTy = dyn_cast<llvm::StructType>(combinedTy)) {
66876689 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 ();
66906692 auto *nativeTy = structTy->getElementType (i);
66916693 elt = convertForDirectError (IGF, elt, nativeTy,
66926694 /* forExtraction*/ false );
@@ -6697,9 +6699,9 @@ void irgen::emitAsyncReturn(IRGenFunction &IGF, AsyncContextLayout &asyncLayout,
66976699 while (!out.empty ()) {
66986700 nativeResultsStorage.push_back (out.claimNext ());
66996701 }
6700- } else if (!result .empty ()) {
6702+ } else if (!native .empty ()) {
67016703 auto *converted = convertForDirectError (
6702- IGF, result .claimNext (), combinedTy, /* forExtraction*/ false );
6704+ IGF, native .claimNext (), combinedTy, /* forExtraction*/ false );
67036705 nativeResultsStorage.push_back (converted);
67046706 } else {
67056707 nativeResultsStorage.push_back (llvm::UndefValue::get (combinedTy));
0 commit comments