From 96f77142374da8a4a7d4e5e8afd559fbaf0430e8 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 30 Aug 2023 10:44:28 -0300 Subject: Field 'Proto.is_vararg' uses only one bit So that the other bits can be used for other purposes. --- lcode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lcode.c') 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) { lua_assert(i == 0 || isOT(*(pc - 1)) == isIT(*pc)); switch (GET_OPCODE(*pc)) { case OP_RETURN0: case OP_RETURN1: { - if (!(fs->needclose || p->is_vararg)) + if (!(fs->needclose || (p->flag & PF_ISVARARG))) break; /* no extra work */ /* else use OP_RETURN to do the extra work */ SET_OPCODE(*pc, OP_RETURN); @@ -1857,7 +1857,7 @@ void luaK_finish (FuncState *fs) { case OP_RETURN: case OP_TAILCALL: { if (fs->needclose) SETARG_k(*pc, 1); /* signal that it needs to close */ - if (p->is_vararg) + if (p->flag & PF_ISVARARG) SETARG_C(*pc, p->numparams + 1); /* signal that it is vararg */ break; } -- cgit v1.2.3-55-g6feb