|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
-** $Id: lfunc.c,v 2.11 2005/05/05 20:47:02 roberto Exp roberto $
|
|
|
+** $Id: lfunc.c,v 2.12 2005/12/22 16:19:56 roberto Exp roberto $
|
|
|
** Auxiliary functions to manipulate prototypes and closures
|
|
|
** See Copyright Notice in lua.h
|
|
|
*/
|
|
@@ -55,7 +55,7 @@ UpVal *luaF_findupval (lua_State *L, StkId level) {
|
|
|
GCObject **pp = &L->openupval;
|
|
|
UpVal *p;
|
|
|
UpVal *uv;
|
|
|
- while ((p = ngcotouv(*pp)) != NULL && p->v >= level) {
|
|
|
+ while (*pp != NULL && (p = ngcotouv(*pp))->v >= level) {
|
|
|
lua_assert(p->v != &p->u.value);
|
|
|
if (p->v == level) { /* found a corresponding upvalue? */
|
|
|
if (isdead(g, obj2gco(p))) /* is it dead? */
|
|
@@ -96,7 +96,7 @@ void luaF_freeupval (lua_State *L, UpVal *uv) {
|
|
|
void luaF_close (lua_State *L, StkId level) {
|
|
|
UpVal *uv;
|
|
|
global_State *g = G(L);
|
|
|
- while ((uv = ngcotouv(L->openupval)) != NULL && uv->v >= level) {
|
|
|
+ while (L->openupval != NULL && (uv = ngcotouv(L->openupval))->v >= level) {
|
|
|
GCObject *o = obj2gco(uv);
|
|
|
lua_assert(!isblack(o) && uv->v != &uv->u.value);
|
|
|
L->openupval = uv->next; /* remove from `open' list */
|