diff options
Diffstat (limited to 'llex.c')
-rw-r--r-- | llex.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 2.19 2006/02/06 18:28:16 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.20 2006/03/09 18:14:31 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 | */ |
@@ -116,10 +116,13 @@ void luaX_syntaxerror (LexState *ls, const char *msg) { | |||
116 | 116 | ||
117 | TString *luaX_newstring (LexState *ls, const char *str, size_t l) { | 117 | TString *luaX_newstring (LexState *ls, const char *str, size_t l) { |
118 | lua_State *L = ls->L; | 118 | lua_State *L = ls->L; |
119 | TValue *o; /* entry for `str' */ | ||
119 | TString *ts = luaS_newlstr(L, str, l); | 120 | TString *ts = luaS_newlstr(L, str, l); |
120 | TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */ | 121 | setsvalue2s(L, L->top++, ts); /* anchor string */ |
122 | o = luaH_setstr(L, ls->fs->h, ts); | ||
121 | if (ttisnil(o)) | 123 | if (ttisnil(o)) |
122 | setbvalue(o, 1); /* make sure `str' will not be collected */ | 124 | setbvalue(o, 1); /* make sure `str' will not be collected */ |
125 | L->top--; | ||
123 | return ts; | 126 | return ts; |
124 | } | 127 | } |
125 | 128 | ||