Skip to content

Commit

Permalink
Check callconv as well
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed Nov 3, 2024
1 parent 97596ae commit 74bbd1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ var_types Compiler::impImportCall(OPCODE opcode,
pResolvedToken->hMethod = ((GenTree*)call->AsCall()->gtCallMethHnd)->AsFptrVal()->gtFptrMethod;
pResolvedToken->hClass = info.compCompHnd->getMethodClass(pResolvedToken->hMethod);
eeGetCallInfo(pResolvedToken, nullptr, CORINFO_CALLINFO_LDFTN, callInfo);
bool sigCompatible = callInfo->sig.numArgs == calliSig.numArgs &&
// We only care about CALLCONV_HASTHIS for managed methods
unsigned targetFlags = (callInfo->sig.callConv & CORINFO_CALLCONV_HASTHIS) ? 0 : CORINFO_FLG_STATIC;
bool sigCompatible = callInfo->sig.numArgs == calliSig.numArgs && mflags == targetFlags &&
impCheckImplicitArgumentCoercion(JITtype2varType(callInfo->sig.retType),
JITtype2varType(calliSig.retType));

Expand Down

0 comments on commit 74bbd1b

Please sign in to comment.