From b2291bfa4761d0c06f2b3bf2f5b87dc9644d996e Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Mon, 13 Apr 2026 14:16:09 -0700 Subject: [PATCH] Fix COM Event ilstub classification The stub was incorrectly classified as a P/Invoke, and we have special handling for P/Invokes for GCStress. Correctly classify the stubs as their own kind of stub (Com events). --- src/coreclr/vm/clrtocomcall.cpp | 2 +- src/coreclr/vm/ilstubcache.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/vm/clrtocomcall.cpp b/src/coreclr/vm/clrtocomcall.cpp index 7592ae55f743f4..ed5aa6f023d7f2 100644 --- a/src/coreclr/vm/clrtocomcall.cpp +++ b/src/coreclr/vm/clrtocomcall.cpp @@ -172,7 +172,7 @@ namespace MethodDesc* pStubMD = ILStubCache::CreateAndLinkNewILStubMethodDesc( pMD->GetLoaderAllocator(), pMD->GetMethodTable(), - PINVOKESTUB_FL_COMEVENTCALL, + PINVOKESTUB_FL_COM | PINVOKESTUB_FL_COMEVENTCALL, pMD->GetModule(), szMetaSig, cbMetaSigSize, diff --git a/src/coreclr/vm/ilstubcache.cpp b/src/coreclr/vm/ilstubcache.cpp index d8ae897fbc43f1..c013fa81d3fe5a 100644 --- a/src/coreclr/vm/ilstubcache.cpp +++ b/src/coreclr/vm/ilstubcache.cpp @@ -124,6 +124,7 @@ namespace case DynamicMethodDesc::StubPInvokeVarArg: return "IL_STUB_PInvoke"; case DynamicMethodDesc::StubReversePInvoke: return "IL_STUB_ReversePInvoke"; case DynamicMethodDesc::StubCLRToCOMInterop: return "IL_STUB_CLRtoCOM"; + case DynamicMethodDesc::StubCLRToCOMEvent: return "IL_STUB_CLRtoCOM_Event"; case DynamicMethodDesc::StubCOMToCLRInterop: return "IL_STUB_COMtoCLR"; case DynamicMethodDesc::StubStructMarshalInterop: return "IL_STUB_StructMarshal"; case DynamicMethodDesc::StubArrayOp: return "IL_STUB_Array";