Browse Source

Fixed accessor

pull/46/head
Anairkoen Schno 5 years ago
parent
commit
975e276756
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      IPA.Loader/Utilities/Accessor.cs

+ 4
- 2
IPA.Loader/Utilities/Accessor.cs View File

@ -36,6 +36,8 @@ namespace IPA.Utilities
var il = dyn.GetILGenerator(); var il = dyn.GetILGenerator();
il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Ldarg_0);
if (!typeof(U).IsValueType)
il.Emit(OpCodes.Ldind_Ref);
il.Emit(OpCodes.Ldflda, field); il.Emit(OpCodes.Ldflda, field);
il.Emit(OpCodes.Ret); il.Emit(OpCodes.Ret);
@ -148,8 +150,8 @@ namespace IPA.Utilities
if (prop == null) if (prop == null)
throw new MissingMemberException(typeof(T).Name, propName); throw new MissingMemberException(typeof(T).Name, propName);
var getM = prop.GetGetMethod();
var setM = prop.GetSetMethod();
var getM = prop.GetGetMethod(true);
var setM = prop.GetSetMethod(true);
Getter getter = null; Getter getter = null;
Setter setter = null; Setter setter = null;
if (getM != null) if (getM != null)


Loading…
Cancel
Save