summaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ldebug.c b/ldebug.c
index 9fca89ec..eea8669f 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 2.5 2004/05/31 18:51:50 roberto Exp roberto $ 2** $Id: ldebug.c,v 2.6 2004/06/02 19:07:55 roberto Exp roberto $
3** Debug Interface 3** Debug Interface
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -276,8 +276,8 @@ static int checkArgMode (const Proto *pt, int r, enum OpArgMask mode) {
276 case OpArgN: check(r == 0); break; 276 case OpArgN: check(r == 0); break;
277 case OpArgU: break; 277 case OpArgU: break;
278 case OpArgR: checkreg(pt, r); break; 278 case OpArgR: checkreg(pt, r); break;
279 case OpArgK: 279 case OpArgK:
280 check(r < pt->maxstacksize || (r >= MAXSTACK && r-MAXSTACK < pt->sizek)); 280 check(ISK(r) ? INDEXK(r) < pt->sizek : r < pt->maxstacksize);
281 break; 281 break;
282 } 282 }
283 return 1; 283 return 1;
@@ -432,9 +432,8 @@ int luaG_checkcode (const Proto *pt) {
432 432
433 433
434static const char *kname (Proto *p, int c) { 434static const char *kname (Proto *p, int c) {
435 c = c - MAXSTACK; 435 if (ISK(c) && ttisstring(&p->k[INDEXK(c)]))
436 if (c >= 0 && ttisstring(&p->k[c])) 436 return svalue(&p->k[INDEXK(c)]);
437 return svalue(&p->k[c]);
438 else 437 else
439 return "?"; 438 return "?";
440} 439}