summaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/ldebug.c b/ldebug.c
index 2a94dc09..d3925a65 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 1.116 2002/05/15 18:57:44 roberto Exp roberto $ 2** $Id: ldebug.c,v 1.117 2002/05/16 18:39:46 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*/
@@ -434,12 +434,10 @@ static const char *getobjname (lua_State *L, CallInfo *ci, int stackpos,
434 case OP_GETTABLE: { 434 case OP_GETTABLE: {
435 *name = kname(p, GETARG_C(i)); 435 *name = kname(p, GETARG_C(i));
436 return "field"; 436 return "field";
437 break;
438 } 437 }
439 case OP_SELF: { 438 case OP_SELF: {
440 *name = kname(p, GETARG_C(i)); 439 *name = kname(p, GETARG_C(i));
441 return "method"; 440 return "method";
442 break;
443 } 441 }
444 default: break; 442 default: break;
445 } 443 }
@@ -475,11 +473,10 @@ static int isinstack (CallInfo *ci, const TObject *o) {
475 473
476 474
477void luaG_typeerror (lua_State *L, const TObject *o, const char *op) { 475void luaG_typeerror (lua_State *L, const TObject *o, const char *op) {
478 const char *name; 476 const char *name = NULL;
479 const char *t = luaT_typenames[ttype(o)]; 477 const char *t = luaT_typenames[ttype(o)];
480 const char *kind = NULL; 478 const char *kind = (isinstack(L->ci, o)) ?
481 if (isinstack(L->ci, o)) 479 getobjname(L, L->ci, o - L->ci->base, &name) : NULL;
482 kind = getobjname(L, L->ci, o - L->ci->base, &name);
483 if (kind) 480 if (kind)
484 luaG_runerror(L, "attempt to %s %s `%s' (a %s value)", 481 luaG_runerror(L, "attempt to %s %s `%s' (a %s value)",
485 op, kind, name, t); 482 op, kind, name, t);