diff options
Diffstat (limited to 'ldebug.c')
| -rw-r--r-- | ldebug.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -184,7 +184,7 @@ static const char *upvalname (const Proto *p, int uv) { | |||
| 184 | 184 | ||
| 185 | 185 | ||
| 186 | static const char *findvararg (CallInfo *ci, int n, StkId *pos) { | 186 | static const char *findvararg (CallInfo *ci, int n, StkId *pos) { |
| 187 | if (clLvalue(s2v(ci->func.p))->p->flag & PF_ISVARARG) { | 187 | if (clLvalue(s2v(ci->func.p))->p->flag & PF_VAHID) { |
| 188 | int nextra = ci->u.l.nextraargs; | 188 | int nextra = ci->u.l.nextraargs; |
| 189 | if (n >= -nextra) { /* 'n' is negative */ | 189 | if (n >= -nextra) { /* 'n' is negative */ |
| 190 | *pos = ci->func.p - nextra - (n + 1); | 190 | *pos = ci->func.p - nextra - (n + 1); |
| @@ -304,7 +304,7 @@ static void collectvalidlines (lua_State *L, Closure *f) { | |||
| 304 | int i; | 304 | int i; |
| 305 | TValue v; | 305 | TValue v; |
| 306 | setbtvalue(&v); /* boolean 'true' to be the value of all indices */ | 306 | setbtvalue(&v); /* boolean 'true' to be the value of all indices */ |
| 307 | if (!(p->flag & PF_ISVARARG)) /* regular function? */ | 307 | if (!(isvararg(p))) /* regular function? */ |
| 308 | i = 0; /* consider all instructions */ | 308 | i = 0; /* consider all instructions */ |
| 309 | else { /* vararg function */ | 309 | else { /* vararg function */ |
| 310 | lua_assert(GET_OPCODE(p->code[0]) == OP_VARARGPREP); | 310 | lua_assert(GET_OPCODE(p->code[0]) == OP_VARARGPREP); |
| @@ -348,7 +348,7 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, | |||
| 348 | ar->nparams = 0; | 348 | ar->nparams = 0; |
| 349 | } | 349 | } |
| 350 | else { | 350 | else { |
| 351 | ar->isvararg = (f->l.p->flag & PF_ISVARARG) ? 1 : 0; | 351 | ar->isvararg = (isvararg(f->l.p)) ? 1 : 0; |
| 352 | ar->nparams = f->l.p->numparams; | 352 | ar->nparams = f->l.p->numparams; |
| 353 | } | 353 | } |
| 354 | break; | 354 | break; |
| @@ -912,7 +912,7 @@ int luaG_tracecall (lua_State *L) { | |||
| 912 | Proto *p = ci_func(ci)->p; | 912 | Proto *p = ci_func(ci)->p; |
| 913 | ci->u.l.trap = 1; /* ensure hooks will be checked */ | 913 | ci->u.l.trap = 1; /* ensure hooks will be checked */ |
| 914 | if (ci->u.l.savedpc == p->code) { /* first instruction (not resuming)? */ | 914 | if (ci->u.l.savedpc == p->code) { /* first instruction (not resuming)? */ |
| 915 | if (p->flag & PF_ISVARARG) | 915 | if (isvararg(p)) |
| 916 | return 0; /* hooks will start at VARARGPREP instruction */ | 916 | return 0; /* hooks will start at VARARGPREP instruction */ |
| 917 | else if (!(ci->callstatus & CIST_HOOKYIELD)) /* not yielded? */ | 917 | else if (!(ci->callstatus & CIST_HOOKYIELD)) /* not yielded? */ |
| 918 | luaD_hookcall(L, ci); /* check 'call' hook */ | 918 | luaD_hookcall(L, ci); /* check 'call' hook */ |
