Skip to content

Commit

Permalink
Update ReflectionMethodBodyScanner.cs (#101031)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalStrehovsky authored Apr 16, 2024
1 parent 69062fd commit d41c3db
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,12 @@ public static bool HandleCall(
if (Intrinsics.GetIntrinsicIdForMethod(callingMethodDefinition) == IntrinsicId.RuntimeReflectionExtensions_GetMethodInfo)
break;

if (param.IsEmpty())
{
// The static value is unknown and the below `foreach` won't execute
reflectionMarker.Dependencies.Add(reflectionMarker.Factory.ReflectedDelegate(null), "Delegate.Method access on unknown delegate type");
}

foreach (var valueNode in param.AsEnumerable())
{
TypeDesc? staticType = (valueNode as IValueWithStaticType)?.StaticType?.Type;
Expand Down

0 comments on commit d41c3db

Please sign in to comment.