small bug (type error)

This commit is contained in:
Roberto Ierusalimschy 2005-06-07 15:53:45 -03:00
parent 3ad03b331d
commit 746a1d612b
3 changed files with 12 additions and 12 deletions

View File

@ -1,5 +1,5 @@
/*
** $Id: lcode.c,v 2.12 2005/03/16 16:59:21 roberto Exp roberto $
** $Id: lcode.c,v 2.13 2005/05/20 15:53:42 roberto Exp roberto $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@ -223,7 +223,7 @@ static int addk (FuncState *fs, TValue *k, TValue *v) {
MAXARG_Bx, "constant table overflow");
while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]);
setobj(L, &f->k[fs->nk], v);
luaC_barriert(L, f, v);
luaC_barrier(L, f, v);
return fs->nk++;
}
}

7
lgc.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lgc.c,v 2.32 2005/05/05 15:34:03 roberto Exp roberto $
** $Id: lgc.c,v 2.33 2005/05/31 14:25:18 roberto Exp roberto $
** Garbage Collector
** See Copyright Notice in lua.h
*/
@ -673,12 +673,13 @@ void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v) {
}
void luaC_barrierback (lua_State *L, GCObject *o) {
void luaC_barrierback (lua_State *L, Table *t) {
global_State *g = G(L);
GCObject *o = obj2gco(t);
lua_assert(isblack(o) && !isdead(g, o));
lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause);
black2gray(o); /* make table gray (again) */
gco2h(o)->gclist = g->grayagain;
t->gclist = g->grayagain;
g->grayagain = o;
}

13
lgc.h
View File

@ -1,5 +1,5 @@
/*
** $Id: lgc.h,v 2.12 2005/02/23 17:30:22 roberto Exp roberto $
** $Id: lgc.h,v 2.13 2005/04/25 19:24:10 roberto Exp roberto $
** Garbage Collector
** See Copyright Notice in lua.h
*/
@ -84,16 +84,15 @@
#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \
luaC_barrierf(L,obj2gco(p),gcvalue(v)); }
#define luaC_barriert(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \
luaC_barrierback(L,obj2gco(p)); }
#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t))) \
luaC_barrierback(L,t); }
#define luaC_objbarrier(L,p,o) \
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
luaC_barrierf(L,obj2gco(p),obj2gco(o)); }
#define luaC_objbarriert(L,p,o) \
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
luaC_barrierback(L,obj2gco(p)); }
#define luaC_objbarriert(L,t,o) \
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); }
LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all);
LUAI_FUNC void luaC_callGCTM (lua_State *L);
@ -103,7 +102,7 @@ LUAI_FUNC void luaC_fullgc (lua_State *L);
LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt);
LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv);
LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);
LUAI_FUNC void luaC_barrierback (lua_State *L, GCObject *o);
LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t);
#endif