Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unblock SDK merge by fixing Assembly.GetCallingAssembly() #69225

Merged
merged 1 commit into from
May 12, 2022
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