From 1fb4d539254b67e7e35ed698250c66d1edff0e08 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 12 Jul 2019 16:13:50 -0300 Subject: OP_NEWTABLE keeps exact size of arrays OP_NEWTABLE is followed by an OP_EXTRAARG, so that it can keep the exact size of the array part of the table to be created. (Functions 'luaO_int2fb'/'luaO_fb2int' were removed.) --- lcode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lcode.c') diff --git a/lcode.c b/lcode.c index 74ff47de..1ff32ed7 100644 --- a/lcode.c +++ b/lcode.c @@ -430,7 +430,7 @@ static int codesJ (FuncState *fs, OpCode o, int sj, int k) { /* ** Emit an "extra argument" instruction (format 'iAx') */ -static int codeextraarg (FuncState *fs, int a) { +int luaK_codeextraarg (FuncState *fs, int a) { lua_assert(a <= MAXARG_Ax); return luaK_code(fs, CREATE_Ax(OP_EXTRAARG, a)); } @@ -446,7 +446,7 @@ static int luaK_codek (FuncState *fs, int reg, int k) { return luaK_codeABx(fs, OP_LOADK, reg, k); else { int p = luaK_codeABx(fs, OP_LOADKX, reg, 0); - codeextraarg(fs, k); + luaK_codeextraarg(fs, k); return p; } } @@ -1687,7 +1687,7 @@ void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) { luaK_codeABC(fs, OP_SETLIST, base, b, c); else if (c <= MAXARG_Ax) { luaK_codeABC(fs, OP_SETLIST, base, b, 0); - codeextraarg(fs, c); + luaK_codeextraarg(fs, c); } else luaX_syntaxerror(fs->ls, "constructor too long"); -- cgit v1.2.3-55-g6feb