Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/coreclr/vm/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ HRESULT EEClass::AddField(MethodTable* pMT, mdFieldDef fieldDef, FieldDesc** ppN
LOG((LF_ENC, LL_INFO100, "EEClass::AddField Checking: %s mod:%p\n", pMod->GetDebugName(), pMod));

EETypeHashTable* paramTypes = pMod->GetAvailableParamTypes();
CrstHolder ch(pMod->GetClassLoader()->GetAvailableTypesLock());

EETypeHashTable::Iterator it(paramTypes);
EETypeHashEntry* pEntry;
while (paramTypes->FindNext(&it, &pEntry))
Expand Down Expand Up @@ -587,6 +589,8 @@ HRESULT EEClass::AddMethod(MethodTable* pMT, mdMethodDef methodDef, MethodDesc**
LOG((LF_ENC, LL_INFO100, "EEClass::AddMethod Checking: %s mod:%p\n", pMod->GetDebugName(), pMod));

EETypeHashTable* paramTypes = pMod->GetAvailableParamTypes();
CrstHolder ch(pMod->GetClassLoader()->GetAvailableTypesLock());

EETypeHashTable::Iterator it(paramTypes);
EETypeHashEntry* pEntry;
while (paramTypes->FindNext(&it, &pEntry))
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/clsload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ VOID ClassLoader::Init(AllocMemTracker *pamTracker)
// This lock is taken within the classloader whenever we have to insert a new param. type into the table.
m_AvailableTypesLock.Init(
CrstAvailableParamTypes,
CRST_DEBUGGER_THREAD);
CrstFlags(CRST_DEBUGGER_THREAD | CRST_GC_NOTRIGGER_WHEN_TAKEN | CRST_UNSAFE_ANYMODE));

#ifdef _DEBUG
CorTypeInfo::CheckConsistency();
Expand Down
7 changes: 7 additions & 0 deletions src/coreclr/vm/clsload.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,13 @@ class ClassLoader


public:

CrstBase *GetAvailableTypesLock()
{
LIMITED_METHOD_CONTRACT;
return &m_AvailableTypesLock;
}

//#LoaderModule
// LoaderModule determines in which module an item gets placed.
// For everything except parameterized types and methods the choice is easy.
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/vm/excep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10824,7 +10824,7 @@ VOID DECLSPEC_NORETURN RealCOMPlusThrowHR(HRESULT hr)
CONTRACTL
{
THROWS;
DISABLED(GC_NOTRIGGER); // Must sanitize first pass handling to enable this
GC_NOTRIGGER;
MODE_ANY;
}
CONTRACTL_END;
Expand All @@ -10837,7 +10837,7 @@ VOID DECLSPEC_NORETURN RealCOMPlusThrowHR(HRESULT hr)
// !
// ! COMPlusThrowHR(hr, kGetErrorInfo)

RealCOMPlusThrowHR(hr, (IErrorInfo*)NULL);
EX_THROW(EEMessageException, (hr));
}

VOID DECLSPEC_NORETURN RealCOMPlusThrowHR(HRESULT hr, tagGetErrorInfo)
Expand Down Expand Up @@ -10883,7 +10883,7 @@ VOID DECLSPEC_NORETURN RealCOMPlusThrowHR(HRESULT hr, UINT resID, LPCWSTR wszArg
CONTRACTL
{
THROWS;
DISABLED(GC_NOTRIGGER); // Must sanitize first pass handling to enable this
GC_NOTRIGGER;
MODE_ANY;
}
CONTRACTL_END;
Expand Down
Loading