new type 'StackValue' for stack elements

(we may want to put extra info there in the future)
This commit is contained in:
Roberto Ierusalimschy
2017-06-29 12:06:44 -03:00
parent 5a1c8d8ef3
commit f96497397a
20 changed files with 409 additions and 351 deletions

4
llex.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: llex.c,v 2.96 2016/05/02 14:02:12 roberto Exp roberto $
** $Id: llex.c,v 2.97 2017/06/09 16:48:44 roberto Exp roberto $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ -129,7 +129,7 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
TValue *o; /* entry for 'str' */
TString *ts = luaS_newlstr(L, str, l); /* create new string */
setsvalue2s(L, L->top++, ts); /* temporarily anchor it in stack */
o = luaH_set(L, ls->h, L->top - 1);
o = luaH_set(L, ls->h, s2v(L->top - 1));
if (ttisnil(o)) { /* not in use yet? */
/* boolean value does not need GC barrier;
table is not a metatable, so it does not need to invalidate cache */