Skip to content

Commit

Permalink
Ensure the function pointer being returned is from an active method. (d…
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronRobinsonMSFT authored May 3, 2020
1 parent 612c9ef commit 3e835d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/coreclr/src/vm/runtimehandles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1752,10 +1752,13 @@ void * QCALLTYPE RuntimeMethodHandle::GetFunctionPointer(MethodDesc * pMethod)
{
QCALL_CONTRACT;

void* funcPtr = 0;
void* funcPtr = NULL;

BEGIN_QCALL;

// Ensure the method is active so
// the function pointer can be used.
pMethod->EnsureActive();
funcPtr = (void*)pMethod->GetMultiCallableAddrOfCode();

END_QCALL;
Expand Down

0 comments on commit 3e835d4

Please sign in to comment.