aboutsummaryrefslogtreecommitdiff
path: root/ldebug.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 /ldebug.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 'ldebug.c')
-rw-r--r--ldebug.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ldebug.c b/ldebug.c
index 690ac38f..1b789520 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -182,7 +182,7 @@ static const char *upvalname (const Proto *p, int uv) {
182 182
183 183
184static const char *findvararg (CallInfo *ci, int n, StkId *pos) { 184static const char *findvararg (CallInfo *ci, int n, StkId *pos) {
185 if (clLvalue(s2v(ci->func.p))->p->is_vararg) { 185 if (clLvalue(s2v(ci->func.p))->p->flag & PF_ISVARARG) {
186 int nextra = ci->u.l.nextraargs; 186 int nextra = ci->u.l.nextraargs;
187 if (n >= -nextra) { /* 'n' is negative */ 187 if (n >= -nextra) { /* 'n' is negative */
188 *pos = ci->func.p - nextra - (n + 1); 188 *pos = ci->func.p - nextra - (n + 1);
@@ -301,7 +301,7 @@ static void collectvalidlines (lua_State *L, Closure *f) {
301 sethvalue2s(L, L->top.p, t); /* push it on stack */ 301 sethvalue2s(L, L->top.p, t); /* push it on stack */
302 api_incr_top(L); 302 api_incr_top(L);
303 setbtvalue(&v); /* boolean 'true' to be the value of all indices */ 303 setbtvalue(&v); /* boolean 'true' to be the value of all indices */
304 if (!p->is_vararg) /* regular function? */ 304 if (!(p->flag & PF_ISVARARG)) /* regular function? */
305 i = 0; /* consider all instructions */ 305 i = 0; /* consider all instructions */
306 else { /* vararg function */ 306 else { /* vararg function */
307 lua_assert(GET_OPCODE(p->code[0]) == OP_VARARGPREP); 307 lua_assert(GET_OPCODE(p->code[0]) == OP_VARARGPREP);
@@ -344,7 +344,7 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar,
344 ar->nparams = 0; 344 ar->nparams = 0;
345 } 345 }
346 else { 346 else {
347 ar->isvararg = f->l.p->is_vararg; 347 ar->isvararg = f->l.p->flag & PF_ISVARARG;
348 ar->nparams = f->l.p->numparams; 348 ar->nparams = f->l.p->numparams;
349 } 349 }
350 break; 350 break;
@@ -878,7 +878,7 @@ int luaG_tracecall (lua_State *L) {
878 Proto *p = ci_func(ci)->p; 878 Proto *p = ci_func(ci)->p;
879 ci->u.l.trap = 1; /* ensure hooks will be checked */ 879 ci->u.l.trap = 1; /* ensure hooks will be checked */
880 if (ci->u.l.savedpc == p->code) { /* first instruction (not resuming)? */ 880 if (ci->u.l.savedpc == p->code) { /* first instruction (not resuming)? */
881 if (p->is_vararg) 881 if (p->flag & PF_ISVARARG)
882 return 0; /* hooks will start at VARARGPREP instruction */ 882 return 0; /* hooks will start at VARARGPREP instruction */
883 else if (!(ci->callstatus & CIST_HOOKYIELD)) /* not yieded? */ 883 else if (!(ci->callstatus & CIST_HOOKYIELD)) /* not yieded? */
884 luaD_hookcall(L, ci); /* check 'call' hook */ 884 luaD_hookcall(L, ci); /* check 'call' hook */