Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/coreclr/vm/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1986,12 +1986,18 @@ MethodDesc* MethodDesc::ResolveGenericVirtualMethod(OBJECTREF *orThis)
pTargetMDBeforeGenericMethodArgs->GetExactClassInstantiation(TypeHandle(pObjMT))).GetMethodTable();
}

// Pass the async variant lookup kind of the target method so that FindOrCreateAssociatedMethodDesc
// creates the correctly-typed instantiated method descriptor (regular async variant, return-dropping
// thunk, or ordinary method). Without this, a resolved async-variant or RDT target would be
// misidentified as an ordinary method and GetParallelMethodDesc would return the primary thunk
// instead, causing infinite virtual dispatch recursion for covariant-return async GVMs.
RETURN(MethodDesc::FindOrCreateAssociatedMethodDesc(
pTargetMDBeforeGenericMethodArgs,
pTargetMT,
(pTargetMT->IsValueType()), /* get unboxing entry point if a struct*/
pStaticMD->GetMethodInstantiation(),
FALSE /* no allowInstParam */ ));
FALSE /* no allowInstParam */,
pTargetMDBeforeGenericMethodArgs->GetAsyncVariantLookup()));
}

PCODE MethodDesc::GetSingleCallableAddrOfCode()
Expand Down
Loading