Skip to content
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.Reflection/tests/MethodInfoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@ public void ToStringTest_ByMethodInfo(MethodInfo methodInfo, string expected)
Assert.Equal(expected, methodInfo.ToString());
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/67269", TestRuntimes.Mono)]
[Fact]
public void InvokeNullableRefs()
{
Expand Down Expand Up @@ -656,7 +655,6 @@ static MethodInfo GetMethod(string name) => typeof(NullableRefMethods).GetMethod
name, BindingFlags.Public | BindingFlags.Static)!;
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/67269", TestRuntimes.Mono)]
[Fact]
public void InvokeBoxedNullableRefs()
{
Expand Down
14 changes: 14 additions & 0 deletions src/mono/mono/metadata/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -4841,6 +4841,20 @@ mono_runtime_try_invoke_span (MonoMethod *method, void *obj, MonoSpanOfObjects *
g_assert (box_exc == NULL);
mono_error_assert_ok (error);
}

if (has_byref_nullables) {
/*
* The runtime invoke wrapper already converted byref nullables back,
* and stored them in pa, we just need to copy them back to the
* managed array.
*/
for (i = 0; i < params_length; i++) {
MonoType *t = sig->params [i];

if (m_type_is_byref (t) && t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type_internal (t)))
mono_span_setref (params_span, i, pa [i]);
}
}
}
goto exit;
exit_null:
Expand Down