Пример #1
0
        public VMSlot GetValue(EmuContext ctx, PointerType type)
        {
            object obj  = this.instance;
            bool   flag = this.field.DeclaringType.IsValueType && this.instance is IReference;

            if (flag)
            {
                obj = ((IReference)this.instance).GetValue(ctx, PointerType.OBJECT).ToObject(this.field.DeclaringType);
            }
            return(VMSlot.FromObject(this.field.GetValue(obj), this.field.FieldType));
        }
Пример #2
0
        public unsafe VMSlot GetValue(EmuContext ctx, PointerType type)
        {
            bool           flag = this._ptr != null;
            TypedReference typedReference;

            if (flag)
            {
                *(&typedReference) = *(TypedReference *)this._ptr.Value;
            }
            else
            {
                *(TypedRef.PseudoTypedRef *)(&typedReference) = this._typedRef;
            }
            return(VMSlot.FromObject(TypedReference.ToObject(typedReference), __reftype(typedReference)));
        }