Skip to content

Commit

Permalink
Fix WXORX issue in EEClass::Destruct (#79696)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
janvorli authored Dec 15, 2022
1 parent 19b0648 commit d065010
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/coreclr/vm/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ void EEClass::Destruct(MethodTable * pOwningMT)
}
if (pDelegateEEClass->m_pInstRetBuffCallStub)
{
pDelegateEEClass->m_pInstRetBuffCallStub->DecRef();
ExecutableWriterHolder<Stub> stubWriterHolder(pDelegateEEClass->m_pInstRetBuffCallStub, sizeof(Stub));
stubWriterHolder.GetRW()->DecRef();
}
// While m_pMultiCastInvokeStub is also a member,
// it is owned by the m_pMulticastStubCache, not by the class
Expand Down

0 comments on commit d065010

Please sign in to comment.