Skip to content

Commit be68496

Browse files
Fix W^X flag for setting ITypeInfo (#75045)
* Fix W^X flag for setting ITypeInfo
1 parent 5eead36 commit be68496

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/coreclr/vm/comcallablewrapper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3851,7 +3851,8 @@ void ComMethodTable::SetITypeInfo(ITypeInfo *pNew)
38513851
}
38523852
CONTRACTL_END;
38533853

3854-
if (InterlockedCompareExchangeT(&m_pITypeInfo, pNew, NULL) == NULL)
3854+
ExecutableWriterHolder<ComMethodTable> comMTWriterHolder(this, sizeof(ComMethodTable));
3855+
if (InterlockedCompareExchangeT(&comMTWriterHolder.GetRW()->m_pITypeInfo, pNew, NULL) == NULL)
38553856
{
38563857
SafeAddRef(pNew);
38573858
}

0 commit comments

Comments
 (0)