public unsafe void SetValue(EmuContext ctx, VMSlot slot, PointerType type) { bool flag = this.field.DeclaringType.IsValueType && this.instance is IReference; if (flag) { TypedReference obj; ((IReference)this.instance).ToTypedReference(ctx, (void *)(&obj), this.field.DeclaringType); this.field.SetValueDirect(obj, slot.ToObject(this.field.FieldType)); } else { this.field.SetValue(this.instance, slot.ToObject(this.field.FieldType)); } }
public unsafe void SetValue(EmuContext ctx, VMSlot slot, PointerType type) { bool flag = this._ptr != null; TypedReference typedReference; if (flag) { *(&typedReference) = *(TypedReference *)this._ptr.Value; } else { *(TypedRef.PseudoTypedRef *)(&typedReference) = this._typedRef; } Type typeFromHandle = __reftype(typedReference); object value = slot.ToObject(typeFromHandle); Helpers.TypedReferenceHelpers.SetTypedRef(value, (void *)(&typedReference)); }