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

[mono] Fix is_byreflike_set on big-endian platforms #64903

Merged
merged 1 commit into from
Feb 8, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public sealed partial class TypeBuilder : TypeInfo

[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
private TypeInfo? created;
private bool is_byreflike_set;
private int is_byreflike_set;

private int state;
#endregion
Expand Down Expand Up @@ -1534,7 +1534,7 @@ public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
}
else if (attrname == "System.Runtime.CompilerServices.IsByRefLikeAttribute")
{
is_byreflike_set = true;
is_byreflike_set = 1;
}

if (cattrs != null)
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/object-internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ struct _MonoReflectionTypeBuilder {
MonoGenericContainer *generic_container;
MonoArray *generic_params;
MonoReflectionType *created;
gboolean is_byreflike_set;
gint32 is_byreflike_set;
gint32 state;
};

Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/sre.c
Original file line number Diff line number Diff line change
Expand Up @@ -3866,7 +3866,7 @@ ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilderHandle ref_
* The IsByRefLike attribute only applies to value types and enums. This matches CoreCLR behavior.
*/
if (klass->enumtype || klass->valuetype)
klass->is_byreflike = MONO_HANDLE_GETVAL (MONO_HANDLE_CAST (MonoReflectionTypeBuilder, ref_tb), is_byreflike_set);
klass->is_byreflike = MONO_HANDLE_GETVAL (MONO_HANDLE_CAST (MonoReflectionTypeBuilder, ref_tb), is_byreflike_set) != 0;

/* enums are done right away */
if (!klass->enumtype)
Expand Down