Field 'Proto.is_vararg' uses only one bit

So that the other bits can be used for other purposes.
This commit is contained in:
Roberto Ierusalimschy
2023-08-30 10:44:28 -03:00
parent 0554581605
commit 96f7714237
8 changed files with 20 additions and 13 deletions

View File

@@ -959,7 +959,7 @@ static void constructor (LexState *ls, expdesc *t) {
static void setvararg (FuncState *fs, int nparams) {
fs->f->is_vararg = 1;
fs->f->flag |= PF_ISVARARG;
luaK_codeABC(fs, OP_VARARGPREP, nparams, 0, 0);
}
@@ -1177,7 +1177,7 @@ static void simpleexp (LexState *ls, expdesc *v) {
}
case TK_DOTS: { /* vararg */
FuncState *fs = ls->fs;
check_condition(ls, fs->f->is_vararg,
check_condition(ls, fs->f->flag & PF_ISVARARG,
"cannot use '...' outside a vararg function");
init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 0, 1));
break;