Skip to content

Commit

Permalink
Fix for get accessors
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 committed Sep 14, 2024
1 parent 7c9a7cb commit b4d52e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Il2CppInterop.Generator/Utils/FieldAccessorGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public static void MakeGetter(FieldDefinition field, FieldRewriteContext fieldCo
getterBody.EmitPointerToObject(fieldContext.OriginalField.Signature!.FieldType, property.Signature.ReturnType,
fieldContext.DeclaringType, local0, !field.IsStatic, false);

if (property.Signature.ReturnType.IsPointerLike())
getterBody.Add(OpCodes.Ldind_I);

getterBody.Add(OpCodes.Ret);

property.GetMethod = getter;
Expand Down

0 comments on commit b4d52e0

Please sign in to comment.