예제 #1
0
 public lua_TValue(lua_TValue copy)
 {
     this.values = copy.values;
     this.index  = copy.index;
     this.value.Copy(copy.value);
     this.tt = copy.tt;
 }
예제 #2
0
 public lua_TValue(lua_TValue value)
 {
     this.values = value.values;
     this.index  = value.index;
     this.value_ = value.value_;                 // todo: do a shallow copy here
     this.tt_    = value.tt_;
 }
예제 #3
0
        private static void traversestack(global_State g, lua_State L)
        {
            StkId o;

            if (L.stack == null)
            {
                return;                                                                  /* stack not completely built yet */
            }
            for (o = new lua_TValue(L.stack); o < L.top; /*StkId.inc(ref o)*/ o = o + 1) //FIXME:L.stack->new StkId(L.stack[0]) //FIXME:don't use StackId.inc(), overflow ([-1])
            {
                markvalue(g, o);

                //------------------------
                if (o >= L.top - 1)
                {
                    break;    //FIXME:added, o + 1 will overflow
                }
                //------------------------
            }
            if (g.gcstate == GCSatomic)                                                                   /* final traversal? */
            {
                StkId limMinus1 = L.stack[L.stacksize - 1]; /* real end of stack */                       //FIXME:L.stack[L.stacksize] will overvlow, changed it
                for (; o <= limMinus1; /*StkId.inc(ref o)*/ o = o + 1) /* clear not-marked stack slice */ //FIXME:overflow, changed 'o < lim' to 'o <= limMinus1'
                {
                    setnilvalue(o);

                    //------------------------
                    if (o >= L.top - 1)
                    {
                        break;        //FIXME:added, o + 1 will overflow
                    }
                    //------------------------
                }
            }
        }
예제 #4
0
            public static void copy(lua_TValue v1, lua_TValue v2)
            {
                v1.value_ = v2.value_;
                v1.tt_    = v2.tt_;
                //FIXME:???see setobj()
//				v1.index = v2.index;
//				v1.value_ = v2.value_;
//				v1._parent = v2._parent;
            }
예제 #5
0
        private static void traversestack(global_State g, lua_State L)
        {
            StkId o;

            if (L.stack == null)
            {
                return;                                             /* stack not completely built yet */
            }
            markvalue(g, gt(L));                                    /* mark global table */
            for (o = new lua_TValue(L.stack); o < L.top; o = o + 1) //FIXME:L.stack->new StkId(L.stack[0]) //FIXME:don't use lua_TValue.inc(), overflow ([-1])
            {
                markvalue(g, o);
            }
            if (g.gcstate == GCSatomic)                     /* final traversal? */
            {
                for (; o <= L.stack_last; StkId.inc(ref o)) /* clear not-marked stack slice */
                {
                    setnilvalue(o);
                }
            }
        }
예제 #6
0
 public static lua_TValue dec(ref lua_TValue value)
 {
     value = value[-1];
     return(value[1]);
 }
예제 #7
0
파일: lobject.cs 프로젝트: raymanyu/kopilua
 public static lua_TValue inc(ref lua_TValue value)
 {
     value = value[1];
     return value[-1];
 }
예제 #8
0
파일: lobject.cs 프로젝트: raymanyu/kopilua
 public lua_TValue(lua_TValue copy)
 {
     this.values = copy.values;
     this.index = copy.index;
     this.value.Copy(copy.value);
     this.tt = copy.tt;
 }
예제 #9
0
 public static void inc(ref lua_TValue value, int n)
 {
     value = value[n];
 }
예제 #10
0
 public static void dec(ref lua_TValue value, int n)
 {
     value = value[-n];
 }