Ejemplo n.º 1
0
 public unsafe void SetValue(DarksVMContext ctx, DarksVMSlot slot, PointerType type)
 {
     if (this.field.DeclaringType.IsValueType && this.instance is IReference)
     {
         TypedReference typedRef;
         ((IReference)this.instance).ToTypedReference(ctx, &typedRef, this.field.DeclaringType);
         this.field.SetValueDirect(typedRef, slot.ToObject(this.field.FieldType));
     }
     else
     {
         this.field.SetValue(this.instance, slot.ToObject(this.field.FieldType));
     }
 }
Ejemplo n.º 2
0
        public void SetValue(DarksVMContext ctx, DarksVMSlot slot, PointerType type)
        {
            TypedReference typedRef;

            if (this._ptr != null)
            {
                *&typedRef = *(TypedReference *)this._ptr.Value;
            }
            else
            {
                *(PseudoTypedRef *)&typedRef = this._typedRef;
            }

            Type   refType = __reftype(typedRef);
            object value   = slot.ToObject(refType);

            TypedReferenceHelpers.SetTypedRef(value, &typedRef);
        }