aboutsummaryrefslogtreecommitdiff
path: root/lfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lfunc.c')
-rw-r--r--lfunc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lfunc.c b/lfunc.c
index 804bf9dc..0945f241 100644
--- a/lfunc.c
+++ b/lfunc.c
@@ -62,12 +62,11 @@ void luaF_initupvals (lua_State *L, LClosure *cl) {
62** Create a new upvalue at the given level, and link it to the list of 62** Create a new upvalue at the given level, and link it to the list of
63** open upvalues of 'L' after entry 'prev'. 63** open upvalues of 'L' after entry 'prev'.
64**/ 64**/
65static UpVal *newupval (lua_State *L, int tbc, StkId level, UpVal **prev) { 65static UpVal *newupval (lua_State *L, StkId level, UpVal **prev) {
66 GCObject *o = luaC_newobj(L, LUA_VUPVAL, sizeof(UpVal)); 66 GCObject *o = luaC_newobj(L, LUA_VUPVAL, sizeof(UpVal));
67 UpVal *uv = gco2upv(o); 67 UpVal *uv = gco2upv(o);
68 UpVal *next = *prev; 68 UpVal *next = *prev;
69 uv->v.p = s2v(level); /* current value lives in the stack */ 69 uv->v.p = s2v(level); /* current value lives in the stack */
70 uv->tbc = tbc;
71 uv->u.open.next = next; /* link it to list of open upvalues */ 70 uv->u.open.next = next; /* link it to list of open upvalues */
72 uv->u.open.previous = prev; 71 uv->u.open.previous = prev;
73 if (next) 72 if (next)
@@ -96,7 +95,7 @@ UpVal *luaF_findupval (lua_State *L, StkId level) {
96 pp = &p->u.open.next; 95 pp = &p->u.open.next;
97 } 96 }
98 /* not found: create a new upvalue after 'pp' */ 97 /* not found: create a new upvalue after 'pp' */
99 return newupval(L, 0, level, pp); 98 return newupval(L, level, pp);
100} 99}
101 100
102 101