aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-08-30 10:44:28 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-08-30 10:44:28 -0300
commit96f77142374da8a4a7d4e5e8afd559fbaf0430e8 (patch)
tree5514ffbf943c95bd5eed14b096a370fefe6586e6 /lparser.c
parent05545816057cfdc54bb58199388a2d8878ae5542 (diff)
downloadlua-96f77142374da8a4a7d4e5e8afd559fbaf0430e8.tar.gz
lua-96f77142374da8a4a7d4e5e8afd559fbaf0430e8.tar.bz2
lua-96f77142374da8a4a7d4e5e8afd559fbaf0430e8.zip
Field 'Proto.is_vararg' uses only one bit
So that the other bits can be used for other purposes.
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lparser.c b/lparser.c
index 81c6df22..a1164510 100644
--- a/lparser.c
+++ b/lparser.c
@@ -959,7 +959,7 @@ static void constructor (LexState *ls, expdesc *t) {
959 959
960 960
961static void setvararg (FuncState *fs, int nparams) { 961static void setvararg (FuncState *fs, int nparams) {
962 fs->f->is_vararg = 1; 962 fs->f->flag |= PF_ISVARARG;
963 luaK_codeABC(fs, OP_VARARGPREP, nparams, 0, 0); 963 luaK_codeABC(fs, OP_VARARGPREP, nparams, 0, 0);
964} 964}
965 965
@@ -1177,7 +1177,7 @@ static void simpleexp (LexState *ls, expdesc *v) {
1177 } 1177 }
1178 case TK_DOTS: { /* vararg */ 1178 case TK_DOTS: { /* vararg */
1179 FuncState *fs = ls->fs; 1179 FuncState *fs = ls->fs;
1180 check_condition(ls, fs->f->is_vararg, 1180 check_condition(ls, fs->f->flag & PF_ISVARARG,
1181 "cannot use '...' outside a vararg function"); 1181 "cannot use '...' outside a vararg function");
1182 init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 0, 1)); 1182 init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 0, 1));
1183 break; 1183 break;