Skip to content

Commit d41c3db

Browse files
Update ReflectionMethodBodyScanner.cs (#101031)
1 parent 69062fd commit d41c3db

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionMethodBodyScanner.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,12 @@ public static bool HandleCall(
656656
if (Intrinsics.GetIntrinsicIdForMethod(callingMethodDefinition) == IntrinsicId.RuntimeReflectionExtensions_GetMethodInfo)
657657
break;
658658

659+
if (param.IsEmpty())
660+
{
661+
// The static value is unknown and the below `foreach` won't execute
662+
reflectionMarker.Dependencies.Add(reflectionMarker.Factory.ReflectedDelegate(null), "Delegate.Method access on unknown delegate type");
663+
}
664+
659665
foreach (var valueNode in param.AsEnumerable())
660666
{
661667
TypeDesc? staticType = (valueNode as IValueWithStaticType)?.StaticType?.Type;

0 commit comments

Comments
 (0)