public unsafe void SetValue(VMContext ctx, VMSlot slot, PointerType type) { if (field.DeclaringType.IsValueType && instance is IReference) { TypedReference typedRef; ((IReference)instance).ToTypedReference(ctx, &typedRef, field.DeclaringType); field.SetValueDirect(typedRef, slot.ToObject(field.FieldType)); } else { field.SetValue(instance, slot.ToObject(field.FieldType)); } }
public void SetValue(VMContext ctx, VMSlot slot, PointerType type) { TypedReference typedRef; if (_ptr != null) { *&typedRef = *(TypedReference *)_ptr.Value; } else { *(PseudoTypedRef *)&typedRef = _typedRef; } var refType = __reftype(typedRef); var value = slot.ToObject(refType); TypedReferenceHelpers.SetTypedRef(value, &typedRef); }