diff --git a/src/coreclr/vm/comcallablewrapper.cpp b/src/coreclr/vm/comcallablewrapper.cpp index b526383f755ea7..e0c5c063ac26cb 100644 --- a/src/coreclr/vm/comcallablewrapper.cpp +++ b/src/coreclr/vm/comcallablewrapper.cpp @@ -3851,7 +3851,8 @@ void ComMethodTable::SetITypeInfo(ITypeInfo *pNew) } CONTRACTL_END; - if (InterlockedCompareExchangeT(&m_pITypeInfo, pNew, NULL) == NULL) + ExecutableWriterHolder comMTWriterHolder(this, sizeof(ComMethodTable)); + if (InterlockedCompareExchangeT(&comMTWriterHolder.GetRW()->m_pITypeInfo, pNew, NULL) == NULL) { SafeAddRef(pNew); }