aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ldebug.c b/ldebug.c
index 0c4439c1..9ff7edeb 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -188,8 +188,8 @@ static const char *upvalname (const Proto *p, int uv) {
188static const char *findvararg (CallInfo *ci, int n, StkId *pos) { 188static const char *findvararg (CallInfo *ci, int n, StkId *pos) {
189 if (clLvalue(s2v(ci->func))->p->is_vararg) { 189 if (clLvalue(s2v(ci->func))->p->is_vararg) {
190 int nextra = ci->u.l.nextraargs; 190 int nextra = ci->u.l.nextraargs;
191 if (n <= nextra) { 191 if (n >= -nextra) { /* 'n' is negative */
192 *pos = ci->func - nextra + (n - 1); 192 *pos = ci->func - nextra - (n + 1);
193 return "(vararg)"; /* generic name for any vararg */ 193 return "(vararg)"; /* generic name for any vararg */
194 } 194 }
195 } 195 }
@@ -202,7 +202,7 @@ const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n, StkId *pos) {
202 const char *name = NULL; 202 const char *name = NULL;
203 if (isLua(ci)) { 203 if (isLua(ci)) {
204 if (n < 0) /* access to vararg values? */ 204 if (n < 0) /* access to vararg values? */
205 return findvararg(ci, -n, pos); 205 return findvararg(ci, n, pos);
206 else 206 else
207 name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci)); 207 name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci));
208 } 208 }