Field 'Proto.is_vararg' uses only one bit
So that the other bits can be used for other purposes.
This commit is contained in:
4
lcode.c
4
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user