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