Ifdef out a piece of unreachable reflection stack (#83067)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Tue, 7 Mar 2023 07:00:18 +0000 (16:00 +0900)
committerGitHub <noreply@github.com>
Tue, 7 Mar 2023 07:00:18 +0000 (16:00 +0900)
This is only reachable if we have a .NET Native-esque SharedLibrary.dll. Method signature comparison calls into the type loader.

src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs

index df28255b46025db7a922942c3afc55cac181462e..45446ed7d8a73af4eaad69c5ee774ebe644d5129 100644 (file)
@@ -924,6 +924,7 @@ namespace Internal.Reflection.Execution
             }
             else
             {
+#if FEATURE_SHARED_LIBRARY
                 uint nameAndSigOffset = entryMethodHandleOrNameAndSigRaw;
                 MethodNameAndSignature nameAndSig;
                 if (!TypeLoaderEnvironment.Instance.TryGetMethodNameAndSignatureFromNativeLayoutOffset(mappingTableModule.Handle, nameAndSigOffset, out nameAndSig))
@@ -937,6 +938,9 @@ namespace Internal.Reflection.Execution
                     Debug.Assert(false);
                     return false;
                 }
+#else
+                throw NotImplemented.ByDesign;
+#endif
             }
 
             return true;