Skip to content

Commit d065010

Browse files
authored
Fix WXORX issue in EEClass::Destruct (#79696)
While investigating failures of some coreclr tests when running in an unloadable context, I've hit AV in EEClass::Destruct in one of the tests. The reason is that we are missing ExecutableWriterHolder when updating refCount on pDelegateEEClass->m_pInstRetBuffCallStub. This change fixes it.
1 parent 19b0648 commit d065010

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/coreclr/vm/class.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ void EEClass::Destruct(MethodTable * pOwningMT)
162162
}
163163
if (pDelegateEEClass->m_pInstRetBuffCallStub)
164164
{
165-
pDelegateEEClass->m_pInstRetBuffCallStub->DecRef();
165+
ExecutableWriterHolder<Stub> stubWriterHolder(pDelegateEEClass->m_pInstRetBuffCallStub, sizeof(Stub));
166+
stubWriterHolder.GetRW()->DecRef();
166167
}
167168
// While m_pMultiCastInvokeStub is also a member,
168169
// it is owned by the m_pMulticastStubCache, not by the class

0 commit comments

Comments
 (0)