]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Don't create unneeded array part for template tables.
authorMike Pall <mike>
Tue, 6 Nov 2012 15:56:25 +0000 (16:56 +0100)
committerMike Pall <mike>
Tue, 6 Nov 2012 15:56:25 +0000 (16:56 +0100)
src/lj_parse.c

index 29def7b477aa77623d04ce8520a651d4bb82bbed..2fecaefc5159478f26617082ca32a87b0f0d17ef 100644 (file)
@@ -1761,7 +1761,7 @@ static void expr_table(LexState *ls, ExpDesc *e)
       TValue k, *v;
       if (!t) {  /* Create template table on demand. */
        BCReg kidx;
-       t = lj_tab_new(fs->L, narr, hsize2hbits(nhash));
+       t = lj_tab_new(fs->L, needarr ? narr : 0, hsize2hbits(nhash));
        kidx = const_gc(fs, obj2gco(t), LJ_TTAB);
        fs->bcbase[pc].ins = BCINS_AD(BC_TDUP, freg-1, kidx);
       }