Skip to content

Commit d93b7b8

Browse files
authored
Fix ResolveToken for TypeSpec with MVAR (#3192)
***NO_CI***
1 parent e0c3cad commit d93b7b8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/CLR/Core/TypeSystem.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,13 @@ bool CLR_RT_TypeDef_Instance::ResolveToken(
10461046
else
10471047
{
10481048
// elem.DataType == DATATYPE_MVAR
1049+
1050+
// Use the *caller's* bound genericType (Stack<Int32>, etc.)
1051+
if (caller == nullptr || caller->genericType == nullptr)
1052+
{
1053+
return false;
1054+
}
1055+
10491056
CLR_RT_GenericParam_Index gpIdx;
10501057
caller->assembly->FindGenericParamAtMethodDef(*caller, elem.GenericParamPosition, gpIdx);
10511058
auto &gp = caller->assembly->crossReferenceGenericParam[gpIdx.GenericParam()];

0 commit comments

Comments
 (0)