Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions src/mono/mono/mini/aot-compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -4584,6 +4584,16 @@ can_marshal_struct (MonoClass *klass)
if (!m_class_is_enumtype (mono_class_from_mono_type_internal (field->type)) && !can_marshal_struct (mono_class_from_mono_type_internal (field->type)))
can_marshal = FALSE;
break;
case MONO_TYPE_CLASS:
/*
* A field whose type is a non-auto-layout (sequential/explicit) class is marshalled
* as an embedded struct, the same way the runtime marshalling code handles it. Allow it
* if the nested class is itself marshallable; otherwise the StructureToPtr/PtrToStructure
Comment thread
pavelsavara marked this conversation as resolved.
Outdated
Comment thread
pavelsavara marked this conversation as resolved.
Outdated
* wrappers are not AOT compiled and full-AOT fails with a JIT-in-aot-only error.
*/
if (!can_marshal_struct (mono_class_from_mono_type_internal (field->type)))
can_marshal = FALSE;
Comment thread
pavelsavara marked this conversation as resolved.
Outdated
break;
case MONO_TYPE_SZARRAY: {
gboolean has_mspec = FALSE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ static void WmGetMinMaxInfo(IntPtr lParam)
Marshal.StructureToPtr(mmi, lParam, true);
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/129508", TestRuntimes.Mono)]
[Fact]
public unsafe static int TestEntryPoint()
{
Expand Down
Loading