Skip to content

Commit

Permalink
[mono] UnsafeAccessor: Enable tests for extern static methods without…
Browse files Browse the repository at this point in the history
… type parameters (dotnet#101265)

* Enable tests for methods without type parameters

* Enable more field tests

* Enable all field tests

* Fix the type to get size for
  • Loading branch information
fanyang-mono authored and matouskozak committed Apr 30, 2024
1 parent 73e2f09 commit 14e3f1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/mono/mono/metadata/marshal-lightweight.c
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,7 @@ method_sig_from_accessor_sig (MonoMethodBuilder *mb, gboolean hasthis, MonoMetho
ret->hasthis = hasthis;
for (int i = 1; i < ret->param_count; i++)
ret->params [i - 1] = ret->params [i];
memset (&ret->params[ret->param_count - 1], 0, sizeof (MonoType)); // just in case
memset (&ret->params[ret->param_count - 1], 0, sizeof (MonoType*)); // just in case
ret->param_count--;
return ret;
}
Expand Down Expand Up @@ -2520,7 +2520,7 @@ emit_unsafe_accessor_method_wrapper (MonoMethodBuilder *mb, MonoMethod *accessor
static void
emit_unsafe_accessor_wrapper_ilgen (MonoMethodBuilder *mb, MonoMethod *accessor_method, MonoMethodSignature *sig, MonoGenericContext *ctx, MonoUnsafeAccessorKind kind, const char *member_name)
{
if (accessor_method->is_inflated || accessor_method->is_generic || mono_class_is_ginst (accessor_method->klass) || ctx != NULL) {
if (accessor_method->is_generic || ctx != NULL) {
mono_mb_emit_exception_full (mb, "System", "BadImageFormatException", "UnsafeAccessor_Generics");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ private void Add(Struct a) =>
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/89439", TestRuntimes.Mono)]
public static void Verify_Generic_AccessStaticFieldClass()
{
Console.WriteLine($"Running {nameof(Verify_Generic_AccessStaticFieldClass)}");
Expand Down Expand Up @@ -99,7 +98,6 @@ public static void Verify_Generic_AccessStaticFieldClass()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/89439", TestRuntimes.Mono)]
public static void Verify_Generic_AccessFieldClass()
{
Console.WriteLine($"Running {nameof(Verify_Generic_AccessFieldClass)}");
Expand Down Expand Up @@ -284,7 +282,6 @@ public static void Verify_Generic_CallCtor()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/89439", TestRuntimes.Mono)]
public static void Verify_Generic_GenericTypeNonGenericInstanceMethod()
{
Console.WriteLine($"Running {nameof(Verify_Generic_GenericTypeNonGenericInstanceMethod)}");
Expand Down Expand Up @@ -358,7 +355,6 @@ public static void Verify_Generic_GenericTypeGenericInstanceMethod()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/89439", TestRuntimes.Mono)]
public static void Verify_Generic_GenericTypeNonGenericStaticMethod()
{
Console.WriteLine($"Running {nameof(Verify_Generic_GenericTypeNonGenericStaticMethod)}");
Expand Down

0 comments on commit 14e3f1d

Please sign in to comment.