aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-08-30 10:44:28 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-08-30 10:44:28 -0300
commit96f77142374da8a4a7d4e5e8afd559fbaf0430e8 (patch)
tree5514ffbf943c95bd5eed14b096a370fefe6586e6 /lcode.c
parent05545816057cfdc54bb58199388a2d8878ae5542 (diff)
downloadlua-96f77142374da8a4a7d4e5e8afd559fbaf0430e8.tar.gz
lua-96f77142374da8a4a7d4e5e8afd559fbaf0430e8.tar.bz2
lua-96f77142374da8a4a7d4e5e8afd559fbaf0430e8.zip
Field 'Proto.is_vararg' uses only one bit
So that the other bits can be used for other purposes.
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lcode.c b/lcode.c
index caac6ba3..914d8cd0 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1849,7 +1849,7 @@ void luaK_finish (FuncState *fs) {
1849 lua_assert(i == 0 || isOT(*(pc - 1)) == isIT(*pc)); 1849 lua_assert(i == 0 || isOT(*(pc - 1)) == isIT(*pc));
1850 switch (GET_OPCODE(*pc)) { 1850 switch (GET_OPCODE(*pc)) {
1851 case OP_RETURN0: case OP_RETURN1: { 1851 case OP_RETURN0: case OP_RETURN1: {
1852 if (!(fs->needclose || p->is_vararg)) 1852 if (!(fs->needclose || (p->flag & PF_ISVARARG)))
1853 break; /* no extra work */ 1853 break; /* no extra work */
1854 /* else use OP_RETURN to do the extra work */ 1854 /* else use OP_RETURN to do the extra work */
1855 SET_OPCODE(*pc, OP_RETURN); 1855 SET_OPCODE(*pc, OP_RETURN);
@@ -1857,7 +1857,7 @@ void luaK_finish (FuncState *fs) {
1857 case OP_RETURN: case OP_TAILCALL: { 1857 case OP_RETURN: case OP_TAILCALL: {
1858 if (fs->needclose) 1858 if (fs->needclose)
1859 SETARG_k(*pc, 1); /* signal that it needs to close */ 1859 SETARG_k(*pc, 1); /* signal that it needs to close */
1860 if (p->is_vararg) 1860 if (p->flag & PF_ISVARARG)
1861 SETARG_C(*pc, p->numparams + 1); /* signal that it is vararg */ 1861 SETARG_C(*pc, p->numparams + 1); /* signal that it is vararg */
1862 break; 1862 break;
1863 } 1863 }