diff options
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 2.57 2011/07/15 12:50:29 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 2.58 2011/07/27 18:07:37 roberto Exp roberto $ |
3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -304,6 +304,8 @@ static int addk (FuncState *fs, TValue *key, TValue *v) { | |||
304 | /* constant not found; create a new entry */ | 304 | /* constant not found; create a new entry */ |
305 | oldsize = f->sizek; | 305 | oldsize = f->sizek; |
306 | k = fs->nk; | 306 | k = fs->nk; |
307 | /* numerical value does not need GC barrier; | ||
308 | table has no metatable, so it does not need to invalidate cache */ | ||
307 | setnvalue(idx, cast_num(k)); | 309 | setnvalue(idx, cast_num(k)); |
308 | luaM_growvector(L, f->k, k, f->sizek, TValue, MAXARG_Ax, "constants"); | 310 | luaM_growvector(L, f->k, k, f->sizek, TValue, MAXARG_Ax, "constants"); |
309 | while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); | 311 | while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); |