Skip to content

Commit

Permalink
Fix WXORX issue in EEClass::Destruct (#79703)
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.

Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
  • Loading branch information
github-actions[bot] and janvorli authored Jan 5, 2023
1 parent 88cff5e commit c79f847
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 c79f847

Please sign in to comment.