diff options
Diffstat (limited to 'lfunc.c')
-rw-r--r-- | lfunc.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lfunc.c,v 2.11 2005/05/05 20:47:02 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 2.12 2005/12/22 16:19:56 roberto Exp roberto $ |
3 | ** Auxiliary functions to manipulate prototypes and closures | 3 | ** Auxiliary functions to manipulate prototypes and closures |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -55,7 +55,7 @@ UpVal *luaF_findupval (lua_State *L, StkId level) { | |||
55 | GCObject **pp = &L->openupval; | 55 | GCObject **pp = &L->openupval; |
56 | UpVal *p; | 56 | UpVal *p; |
57 | UpVal *uv; | 57 | UpVal *uv; |
58 | while ((p = ngcotouv(*pp)) != NULL && p->v >= level) { | 58 | while (*pp != NULL && (p = ngcotouv(*pp))->v >= level) { |
59 | lua_assert(p->v != &p->u.value); | 59 | lua_assert(p->v != &p->u.value); |
60 | if (p->v == level) { /* found a corresponding upvalue? */ | 60 | if (p->v == level) { /* found a corresponding upvalue? */ |
61 | if (isdead(g, obj2gco(p))) /* is it dead? */ | 61 | if (isdead(g, obj2gco(p))) /* is it dead? */ |
@@ -96,7 +96,7 @@ void luaF_freeupval (lua_State *L, UpVal *uv) { | |||
96 | void luaF_close (lua_State *L, StkId level) { | 96 | void luaF_close (lua_State *L, StkId level) { |
97 | UpVal *uv; | 97 | UpVal *uv; |
98 | global_State *g = G(L); | 98 | global_State *g = G(L); |
99 | while ((uv = ngcotouv(L->openupval)) != NULL && uv->v >= level) { | 99 | while (L->openupval != NULL && (uv = ngcotouv(L->openupval))->v >= level) { |
100 | GCObject *o = obj2gco(uv); | 100 | GCObject *o = obj2gco(uv); |
101 | lua_assert(!isblack(o) && uv->v != &uv->u.value); | 101 | lua_assert(!isblack(o) && uv->v != &uv->u.value); |
102 | L->openupval = uv->next; /* remove from `open' list */ | 102 | L->openupval = uv->next; /* remove from `open' list */ |