Skip to content

Commit ac85d6f

Browse files
Fix static virtual methods for delegate creation (#118470)
* 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
1 parent 0bb2f6e commit ac85d6f

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/coreclr/inc/vptr_list.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ VPTR_CLASS(CallCountingStubManager)
4242
VPTR_CLASS(PEImageLayout)
4343
VPTR_CLASS(ConvertedImageLayout)
4444
VPTR_CLASS(LoadedImageLayout)
45+
VPTR_CLASS(NativeImageLayout)
4546
VPTR_CLASS(FlatImageLayout)
4647

4748
#ifdef DEBUGGING_SUPPORTED

src/coreclr/vm/peimagelayout.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,18 @@ class LoadedImageLayout: public PEImageLayout
145145
#endif // !DACCESS_COMPILE
146146
};
147147

148-
#ifndef DACCESS_COMPILE
149148
// A special layout that is used to load standalone composite r2r files.
150149
// This layout is not owned by a PEImage and created by simply loading the file
151150
// at the given path.
152151
class NativeImageLayout : public PEImageLayout
153152
{
154153
VPTR_VTABLE_CLASS(NativeImageLayout, PEImageLayout)
155-
156-
public:
154+
155+
public:
156+
#ifndef DACCESS_COMPILE
157157
NativeImageLayout(LPCWSTR fullPath);
158-
};
159158
#endif
159+
};
160160

161161
#endif // PEIMAGELAYOUT_H_
162162

src/coreclr/vm/zapsig.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,11 @@ MethodDesc *ZapSig::DecodeMethod(ModuleBase *pInfoModule,
953953
MemberLoader::ThrowMissingMethodException(constrainedType.GetMethodTable(), NULL, NULL, NULL, 0, NULL);
954954
}
955955

956+
if (directMethod->IsStatic() && (ppTH != NULL))
957+
{
958+
*ppTH = directMethod->GetMethodTable();
959+
}
960+
956961
// Strip the instantiating stub if the signature did not ask for one
957962
if (directMethod->IsInstantiatingStub() && !isInstantiatingStub)
958963
{

src/tests/issues.targets

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,12 +540,6 @@
540540
<ExcludeList Include="$(XunitTestBinBase)/JIT/superpmi/superpmicollect/*">
541541
<Issue>Not compatible with crossgen2</Issue>
542542
</ExcludeList>
543-
<ExcludeList Include="$(XunitTestBinBase)/Loader/classloader/StaticVirtualMethods/GenericContext/GenericContextTestDefaultImp/**">
544-
<Issue>https://github.com/dotnet/runtime/issues/109200</Issue>
545-
</ExcludeList>
546-
<ExcludeList Include="$(XunitTestBinBase)/Loader/classloader/StaticVirtualMethods/GenericContext/GenericContextTest/**">
547-
<Issue>https://github.com/dotnet/runtime/issues/109200</Issue>
548-
</ExcludeList>
549543
<ExcludeList Include="$(XunitTestBinBase)/Regressions/coreclr/GitHub_68278/**">
550544
<Issue>https://github.com/dotnet/runtime/issues/108255</Issue>
551545
</ExcludeList>

0 commit comments

Comments
 (0)