diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-17 14:33:38 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-17 14:33:38 -0200 |
| commit | 35fa276099bba69c4def7304e53a8962b3ab00fc (patch) | |
| tree | b023d5f43da9aa0622f6a6b9e9148226acf7d33a /llex.c | |
| parent | b51d76ce8dfeb1dd3cc3e69b32cf665ff32ff26e (diff) | |
| download | lua-35fa276099bba69c4def7304e53a8962b3ab00fc.tar.gz lua-35fa276099bba69c4def7304e53a8962b3ab00fc.tar.bz2 lua-35fa276099bba69c4def7304e53a8962b3ab00fc.zip | |
parser/scanner keep GC running
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 | } |
