added check for conversion 'obj2gco' (and corrections for small

problems detected by this check)
This commit is contained in:
Roberto Ierusalimschy
2014-07-18 09:17:54 -03:00
parent 9aec500a26
commit 56137d58ff
10 changed files with 51 additions and 39 deletions

6
llex.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: llex.c,v 2.77 2014/05/11 14:45:43 roberto Exp roberto $
** $Id: llex.c,v 2.78 2014/05/21 15:22:02 roberto Exp roberto $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ -67,10 +67,10 @@ static void save (LexState *ls, int c) {
void luaX_init (lua_State *L) {
int i;
TString *e = luaS_new(L, LUA_ENV); /* create env name */
luaC_fix(L, obj2gco(e)); /* never collect this name */
luaC_fix(L, ts2gco(e)); /* never collect this name */
for (i=0; i<NUM_RESERVED; i++) {
TString *ts = luaS_new(L, luaX_tokens[i]);
luaC_fix(L, obj2gco(ts)); /* reserved words are never collected */
luaC_fix(L, ts2gco(ts)); /* reserved words are never collected */
ts->tsv.extra = cast_byte(i+1); /* reserved word */
}
}