mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
Field 'Proto.is_vararg' uses only one bit
So that the other bits can be used for other purposes.
This commit is contained in:
parent
0554581605
commit
96f7714237
8 changed files with 20 additions and 13 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue