Skip to content

Commit 47da68b

Browse files
Take process lock earlier (#105280)
1 parent b6741a7 commit 47da68b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/coreclr/debug/di/divalue.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,22 +2691,22 @@ HRESULT CordbObjectValue::GetFunctionHelper(ICorDebugFunction **ppFunction)
26912691
if (hr != S_OK)
26922692
return hr;
26932693

2694-
mdMethodDef functionMethodDef = 0;
2695-
VMPTR_DomainAssembly functionDomainAssembly;
2696-
NativeCodeFunctionData nativeCodeForDelFunc;
2697-
2698-
hr = pDAC->GetDelegateFunctionData(delType, pDelegateObj, &functionDomainAssembly, &functionMethodDef);
2699-
if (hr != S_OK)
2700-
return hr;
2701-
2702-
// TODO: How to ensure results are sanitized?
2703-
// Also, this is expensive. Do we really care that much about this?
2704-
pDAC->GetNativeCodeInfo(functionDomainAssembly, functionMethodDef, &nativeCodeForDelFunc);
2705-
2706-
RSSmartPtr<CordbModule> funcModule(GetProcess()->LookupOrCreateModule(functionDomainAssembly));
27072694
RSSmartPtr<CordbFunction> func;
27082695
{
27092696
RSLockHolder lockHolder(GetProcess()->GetProcessLock());
2697+
2698+
VMPTR_DomainAssembly functionDomainAssembly;
2699+
mdMethodDef functionMethodDef = 0;
2700+
hr = pDAC->GetDelegateFunctionData(delType, pDelegateObj, &functionDomainAssembly, &functionMethodDef);
2701+
if (hr != S_OK)
2702+
return hr;
2703+
2704+
// TODO: How to ensure results are sanitized?
2705+
// Also, this is expensive. Do we really care that much about this?
2706+
NativeCodeFunctionData nativeCodeForDelFunc;
2707+
pDAC->GetNativeCodeInfo(functionDomainAssembly, functionMethodDef, &nativeCodeForDelFunc);
2708+
2709+
RSSmartPtr<CordbModule> funcModule(GetProcess()->LookupOrCreateModule(functionDomainAssembly));
27102710
func.Assign(funcModule->LookupOrCreateFunction(functionMethodDef, nativeCodeForDelFunc.encVersion));
27112711
}
27122712

0 commit comments

Comments
 (0)