aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-18 09:17:54 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-18 09:17:54 -0300
commit56137d58ff7abe8cb22ee3469366e08888c84f28 (patch)
tree6769e3c2403a69cf3f0d6dbf6fb4acb7442367e0 /lparser.c
parent9aec500a2691d2b13c307d143868c8a4fab33220 (diff)
downloadlua-56137d58ff7abe8cb22ee3469366e08888c84f28.tar.gz
lua-56137d58ff7abe8cb22ee3469366e08888c84f28.tar.bz2
lua-56137d58ff7abe8cb22ee3469366e08888c84f28.zip
added check for conversion 'obj2gco' (and corrections for small
problems detected by this check)
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lparser.c b/lparser.c
index 9ad4b8db..5fec4583 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 2.138 2013/12/30 20:47:58 roberto Exp roberto $ 2** $Id: lparser.c,v 2.139 2014/06/19 18:27:20 roberto Exp roberto $
3** Lua Parser 3** Lua Parser
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -164,7 +164,7 @@ static int registerlocalvar (LexState *ls, TString *varname) {
164 LocVar, SHRT_MAX, "local variables"); 164 LocVar, SHRT_MAX, "local variables");
165 while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL; 165 while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL;
166 f->locvars[fs->nlocvars].varname = varname; 166 f->locvars[fs->nlocvars].varname = varname;
167 luaC_objbarrier(ls->L, f, varname); 167 luaC_objbarrier(ls->L, f, ts2gco(varname));
168 return fs->nlocvars++; 168 return fs->nlocvars++;
169} 169}
170 170
@@ -232,7 +232,7 @@ static int newupvalue (FuncState *fs, TString *name, expdesc *v) {
232 f->upvalues[fs->nups].instack = (v->k == VLOCAL); 232 f->upvalues[fs->nups].instack = (v->k == VLOCAL);
233 f->upvalues[fs->nups].idx = cast_byte(v->u.info); 233 f->upvalues[fs->nups].idx = cast_byte(v->u.info);
234 f->upvalues[fs->nups].name = name; 234 f->upvalues[fs->nups].name = name;
235 luaC_objbarrier(fs->ls->L, f, name); 235 luaC_objbarrier(fs->ls->L, f, ts2gco(name));
236 return fs->nups++; 236 return fs->nups++;
237} 237}
238 238
@@ -1630,7 +1630,7 @@ LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
1630 incr_top(L); 1630 incr_top(L);
1631 funcstate.f = cl->p = luaF_newproto(L); 1631 funcstate.f = cl->p = luaF_newproto(L);
1632 funcstate.f->source = luaS_new(L, name); /* create and anchor TString */ 1632 funcstate.f->source = luaS_new(L, name); /* create and anchor TString */
1633 luaC_objbarrier(L, funcstate.f, funcstate.f->source); 1633 luaC_objbarrier(L, funcstate.f, ts2gco(funcstate.f->source));
1634 lexstate.buff = buff; 1634 lexstate.buff = buff;
1635 lexstate.dyd = dyd; 1635 lexstate.dyd = dyd;
1636 dyd->actvar.n = dyd->gt.n = dyd->label.n = 0; 1636 dyd->actvar.n = dyd->gt.n = dyd->label.n = 0;