Skip to content

Take process lock earlier #105280

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

Merged
merged 1 commit into from
Jul 22, 2024
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
26 changes: 13 additions & 13 deletions src/coreclr/debug/di/divalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2691,22 +2691,22 @@ HRESULT CordbObjectValue::GetFunctionHelper(ICorDebugFunction **ppFunction)
if (hr != S_OK)
return hr;

mdMethodDef functionMethodDef = 0;
VMPTR_DomainAssembly functionDomainAssembly;
NativeCodeFunctionData nativeCodeForDelFunc;

hr = pDAC->GetDelegateFunctionData(delType, pDelegateObj, &functionDomainAssembly, &functionMethodDef);
if (hr != S_OK)
return hr;

// TODO: How to ensure results are sanitized?
// Also, this is expensive. Do we really care that much about this?
pDAC->GetNativeCodeInfo(functionDomainAssembly, functionMethodDef, &nativeCodeForDelFunc);

RSSmartPtr<CordbModule> funcModule(GetProcess()->LookupOrCreateModule(functionDomainAssembly));
RSSmartPtr<CordbFunction> func;
{
RSLockHolder lockHolder(GetProcess()->GetProcessLock());

VMPTR_DomainAssembly functionDomainAssembly;
mdMethodDef functionMethodDef = 0;
hr = pDAC->GetDelegateFunctionData(delType, pDelegateObj, &functionDomainAssembly, &functionMethodDef);
if (hr != S_OK)
return hr;

// TODO: How to ensure results are sanitized?
// Also, this is expensive. Do we really care that much about this?
NativeCodeFunctionData nativeCodeForDelFunc;
pDAC->GetNativeCodeInfo(functionDomainAssembly, functionMethodDef, &nativeCodeForDelFunc);

RSSmartPtr<CordbModule> funcModule(GetProcess()->LookupOrCreateModule(functionDomainAssembly));
func.Assign(funcModule->LookupOrCreateFunction(functionMethodDef, nativeCodeForDelFunc.encVersion));
}

Expand Down
Loading