From 2d43376b6a7f8f3af4e0236b5d124e825016084e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 7 Mar 2023 12:42:57 +0900 Subject: [PATCH] Ifdef out a piece of unreachable reflection stack This is only reachable if we have a .NET Native-esque SharedLibrary.dll. Method signature comparison calls into the type loader. --- .../ExecutionEnvironmentImplementation.MappingTables.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs index df28255b46025d..45446ed7d8a73a 100644 --- a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs +++ b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs @@ -924,6 +924,7 @@ private unsafe bool TryGetMethodForOriginalLdFtnResult_InvokeMap_Inner(NativeFor } else { +#if FEATURE_SHARED_LIBRARY uint nameAndSigOffset = entryMethodHandleOrNameAndSigRaw; MethodNameAndSignature nameAndSig; if (!TypeLoaderEnvironment.Instance.TryGetMethodNameAndSignatureFromNativeLayoutOffset(mappingTableModule.Handle, nameAndSigOffset, out nameAndSig)) @@ -937,6 +938,9 @@ private unsafe bool TryGetMethodForOriginalLdFtnResult_InvokeMap_Inner(NativeFor Debug.Assert(false); return false; } +#else + throw NotImplemented.ByDesign; +#endif } return true;