Skip to content
Merged
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
17 changes: 8 additions & 9 deletions src/coreclr/vm/appdomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1521,9 +1521,15 @@ bool SystemDomain::IsReflectionInvocationMethod(MethodDesc* pMeth)
}
CONTRACTL_END;

MethodTable* pCaller = pMeth->GetMethodTable();
// Check for dynamically generated Invoke methods.
if (pMeth->IsDynamicMethod())
{
if (strncmp(pMeth->GetName(), "InvokeStub_", ARRAY_SIZE("InvokeStub_") - 1) == 0)
return true;
}

// All Reflection Invocation methods are defined in CoreLib
// All other reflection invocation methods are defined in CoreLib.
MethodTable* pCaller = pMeth->GetMethodTable();
if (!pCaller->GetModule()->IsSystem())
return false;

Expand Down Expand Up @@ -1579,13 +1585,6 @@ bool SystemDomain::IsReflectionInvocationMethod(MethodDesc* pMeth)
if (CoreLibBinder::GetExistingClass(reflectionInvocationTypes[i]) == pCaller)
return true;
}

// Check for dynamically generated Invoke methods.
if (pMeth->IsDynamicMethod())
{
if (strncmp(pMeth->GetName(), "InvokeStub_", ARRAY_SIZE("InvokeStub_") - 1) == 0)
return true;
}
}

return false;
Expand Down