From b2bac6e9e963b3e6c02662368507c72550f4c154 Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Wed, 6 Aug 2025 15:08:44 -0700 Subject: [PATCH 1/2] Fix static virtual methods for delegate creation - Notably for creation of delegates to SVM methods which do not require generic dictionary lookups - Also a drive by fix of the vtable handling for NativeImageLayout which was causing crashes of the DAC when used in debug builds Fixes #109200 --- src/coreclr/inc/vptr_list.h | 1 + src/coreclr/vm/peimagelayout.h | 8 ++++---- src/coreclr/vm/zapsig.cpp | 5 +++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/coreclr/inc/vptr_list.h b/src/coreclr/inc/vptr_list.h index b5581b019478b5..8fade7caa332bf 100644 --- a/src/coreclr/inc/vptr_list.h +++ b/src/coreclr/inc/vptr_list.h @@ -42,6 +42,7 @@ VPTR_CLASS(CallCountingStubManager) VPTR_CLASS(PEImageLayout) VPTR_CLASS(ConvertedImageLayout) VPTR_CLASS(LoadedImageLayout) +VPTR_CLASS(NativeImageLayout) VPTR_CLASS(FlatImageLayout) #ifdef DEBUGGING_SUPPORTED diff --git a/src/coreclr/vm/peimagelayout.h b/src/coreclr/vm/peimagelayout.h index e086e023d7dcbb..79b5efda31b257 100644 --- a/src/coreclr/vm/peimagelayout.h +++ b/src/coreclr/vm/peimagelayout.h @@ -145,18 +145,18 @@ class LoadedImageLayout: public PEImageLayout #endif // !DACCESS_COMPILE }; -#ifndef DACCESS_COMPILE // A special layout that is used to load standalone composite r2r files. // This layout is not owned by a PEImage and created by simply loading the file // at the given path. class NativeImageLayout : public PEImageLayout { VPTR_VTABLE_CLASS(NativeImageLayout, PEImageLayout) - -public: + + public: +#ifndef DACCESS_COMPILE NativeImageLayout(LPCWSTR fullPath); -}; #endif +}; #endif // PEIMAGELAYOUT_H_ diff --git a/src/coreclr/vm/zapsig.cpp b/src/coreclr/vm/zapsig.cpp index 6b6ce6c45c1c8b..09d9800df3e143 100644 --- a/src/coreclr/vm/zapsig.cpp +++ b/src/coreclr/vm/zapsig.cpp @@ -953,6 +953,11 @@ MethodDesc *ZapSig::DecodeMethod(ModuleBase *pInfoModule, MemberLoader::ThrowMissingMethodException(constrainedType.GetMethodTable(), NULL, NULL, NULL, 0, NULL); } + if (directMethod->IsStatic() && (ppTH != NULL)) + { + *ppTH = directMethod->GetMethodTable(); + } + // Strip the instantiating stub if the signature did not ask for one if (directMethod->IsInstantiatingStub() && !isInstantiatingStub) { From 707b5c0c1174d516824a2c760ffa025c2e3618f5 Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Wed, 6 Aug 2025 15:12:21 -0700 Subject: [PATCH 2/2] Update issues.targets --- src/tests/issues.targets | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/tests/issues.targets b/src/tests/issues.targets index 49ffcb88a3453f..ef67ebaf5105ec 100644 --- a/src/tests/issues.targets +++ b/src/tests/issues.targets @@ -540,12 +540,6 @@ Not compatible with crossgen2 - - https://github.com/dotnet/runtime/issues/109200 - - - https://github.com/dotnet/runtime/issues/109200 - https://github.com/dotnet/runtime/issues/108255