diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-23 10:16:18 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-23 10:16:18 -0300 |
commit | 9243c414d92c253edd908f438caa31e2aa16f3f4 (patch) | |
tree | e8959a48f4672037aef061cc6eb82bba21d0766b /llex.c | |
parent | 477ca2fe8ceaf79038972977915987adbef0e425 (diff) | |
download | lua-9243c414d92c253edd908f438caa31e2aa16f3f4.tar.gz lua-9243c414d92c253edd908f438caa31e2aa16f3f4.tar.bz2 lua-9243c414d92c253edd908f438caa31e2aa16f3f4.zip |
first version of empty entries in tables
(so that, in the future, tables can contain regular nil entries)
Diffstat (limited to 'llex.c')
-rw-r--r-- | llex.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 2.98 2017/06/29 15:06:44 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.99 2018/01/28 15:13:26 roberto Exp roberto $ |
3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -130,7 +130,7 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) { | |||
130 | TString *ts = luaS_newlstr(L, str, l); /* create new string */ | 130 | TString *ts = luaS_newlstr(L, str, l); /* create new string */ |
131 | setsvalue2s(L, L->top++, ts); /* temporarily anchor it in stack */ | 131 | setsvalue2s(L, L->top++, ts); /* temporarily anchor it in stack */ |
132 | o = luaH_set(L, ls->h, s2v(L->top - 1)); | 132 | o = luaH_set(L, ls->h, s2v(L->top - 1)); |
133 | if (ttisnil(o)) { /* not in use yet? */ | 133 | if (isempty(o)) { /* not in use yet? */ |
134 | /* boolean value does not need GC barrier; | 134 | /* boolean value does not need GC barrier; |
135 | table is not a metatable, so it does not need to invalidate cache */ | 135 | table is not a metatable, so it does not need to invalidate cache */ |
136 | setbvalue(o, 1); /* t[string] = true */ | 136 | setbvalue(o, 1); /* t[string] = true */ |