Skip to content

Commit

Permalink
Revert "Fix Assembly.GetCallingAssembly() (dotnet#69225)"
Browse files Browse the repository at this point in the history
This reverts commit 8420dae.
  • Loading branch information
jkotas committed May 15, 2022
1 parent e50de74 commit 919a712
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/coreclr/vm/appdomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1521,15 +1521,9 @@ bool SystemDomain::IsReflectionInvocationMethod(MethodDesc* pMeth)
}
CONTRACTL_END;

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

// All other reflection invocation methods are defined in CoreLib.
MethodTable* pCaller = pMeth->GetMethodTable();

// All Reflection Invocation methods are defined in CoreLib
if (!pCaller->GetModule()->IsSystem())
return false;

Expand Down Expand Up @@ -1585,6 +1579,13 @@ 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

0 comments on commit 919a712

Please sign in to comment.