diff options
Diffstat (limited to 'llex.c')
-rw-r--r-- | llex.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 2.32 2009/03/11 13:27:32 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.33 2009/05/18 17:28:04 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 | */ |
@@ -123,8 +123,10 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) { | |||
123 | TString *ts = luaS_newlstr(L, str, l); | 123 | TString *ts = luaS_newlstr(L, str, l); |
124 | setsvalue2s(L, L->top++, ts); /* anchor string */ | 124 | setsvalue2s(L, L->top++, ts); /* anchor string */ |
125 | o = luaH_setstr(L, ls->fs->h, ts); | 125 | o = luaH_setstr(L, ls->fs->h, ts); |
126 | if (ttisnil(o)) | 126 | if (ttisnil(o)) { |
127 | setbvalue(o, 1); /* make sure `str' will not be collected */ | 127 | setbvalue(o, 1); /* make sure `str' will not be collected */ |
128 | luaC_checkGC(L); | ||
129 | } | ||
128 | L->top--; | 130 | L->top--; |
129 | return ts; | 131 | return ts; |
130 | } | 132 | } |