Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[interp] Fix open delegates used with virtual methods of valuetypes #55354

Merged
merged 2 commits into from
Jul 10, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions src/libraries/System.Runtime/tests/System/DelegateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,6 @@ public static void CreateDelegate9_Type_Null()
Assert.NotNull(ex.Message);
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/49839", TestRuntimes.Mono)]
[Fact]
public static void CreateDelegate10_Nullable_Method()
{
Expand All @@ -1130,7 +1129,6 @@ public static void CreateDelegate10_Nullable_Method()
Assert.Equal(num.ToString(), s);
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/49839", TestRuntimes.Mono)]
[Fact]
public static void CreateDelegate10_Nullable_ClosedDelegate()
{
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/mini/interp/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3433,7 +3433,7 @@ interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs
del_imethod = mono_interp_get_imethod (mono_marshal_get_native_wrapper (del_imethod->method, FALSE, FALSE), error);
mono_error_assert_ok (error);
del->interp_invoke_impl = del_imethod;
} else if (del_imethod->method->flags & METHOD_ATTRIBUTE_VIRTUAL && !del->target) {
} else if (del_imethod->method->flags & METHOD_ATTRIBUTE_VIRTUAL && !del->target && !m_class_is_valuetype (del_imethod->method->klass)) {
// 'this' is passed dynamically, we need to recompute the target method
// with each call
del_imethod = get_virtual_method (del_imethod, LOCAL_VAR (call_args_offset + MINT_STACK_SLOT_SIZE, MonoObject*)->vtable);
Expand Down