Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -228,27 +228,15 @@ private IntPtr GetActualTargetFunctionPointer(object thisObject)
return OpenMethodResolver.ResolveMethod(_extraFunctionPointerOrData, thisObject);
}

internal bool IsDynamicDelegate() => GetThunk(MulticastThunk) == IntPtr.Zero;

[DebuggerGuidedStepThroughAttribute]
protected virtual object? DynamicInvokeImpl(object?[]? args)
{
if (IsDynamicDelegate())
{
// DynamicDelegate case
object? result = ((Func<object?[]?, object?>)_helperObject)(args);
DebugAnnotations.PreviousCallContainsDebuggerStepInCode();
return result;
}
else
{
DynamicInvokeInfo dynamicInvokeInfo = ReflectionAugments.GetDelegateDynamicInvokeInfo(GetType());
DynamicInvokeInfo dynamicInvokeInfo = ReflectionAugments.GetDelegateDynamicInvokeInfo(GetType());

object? result = dynamicInvokeInfo.Invoke(_target, _methodPtr,
args, binderBundle: null, wrapInTargetInvocationException: true);
DebugAnnotations.PreviousCallContainsDebuggerStepInCode();
return result;
}
object? result = dynamicInvokeInfo.Invoke(_target, _methodPtr,
args, binderBundle: null, wrapInTargetInvocationException: true);
DebugAnnotations.PreviousCallContainsDebuggerStepInCode();
return result;
}

protected virtual MethodInfo GetMethodImpl()
Expand Down Expand Up @@ -492,9 +480,6 @@ protected Delegate CombineImpl(Delegate? d)
if (!InternalEqualTypes(this, d))
throw new ArgumentException(SR.Arg_DlgtTypeMis);

if (IsDynamicDelegate())
throw new InvalidOperationException();

int followCount = 1;
Wrapper[]? followList = d._helperObject as Wrapper[];
if (followList != null)
Expand Down
Loading