Skip to content

Commit 518be54

Browse files
[release/7.0] Fix W^X flag for setting ITypeInfo (#75046)
* Fix W^X flag for setting ITypeInfo * Grab address from the holder. Co-authored-by: Aaron Robinson <arobins@microsoft.com>
1 parent b78f82b commit 518be54

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)