diff options
Diffstat (limited to 'ldebug.c')
| -rw-r--r-- | ldebug.c | 7 |
1 files changed, 3 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldebug.c,v 2.17 2005/05/05 20:47:02 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.18 2005/05/16 18:45:15 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 | */ |
| @@ -236,8 +236,7 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { | |||
| 236 | lua_lock(L); | 236 | lua_lock(L); |
| 237 | if (*what == '>') { | 237 | if (*what == '>') { |
| 238 | StkId func = L->top - 1; | 238 | StkId func = L->top - 1; |
| 239 | if (!ttisfunction(func)) | 239 | luai_apicheck(L, ttisfunction(func)); |
| 240 | luaG_runerror(L, "value for `lua_getinfo' is not a function"); | ||
| 241 | what++; /* skip the '>' */ | 240 | what++; /* skip the '>' */ |
| 242 | f = clvalue(func); | 241 | f = clvalue(func); |
| 243 | L->top--; /* pop function */ | 242 | L->top--; /* pop function */ |
| @@ -549,7 +548,7 @@ void luaG_typeerror (lua_State *L, const TValue *o, const char *op) { | |||
| 549 | const char *kind = (isinstack(L->ci, o)) ? | 548 | const char *kind = (isinstack(L->ci, o)) ? |
| 550 | getobjname(L, L->ci, o - L->base, &name) : NULL; | 549 | getobjname(L, L->ci, o - L->base, &name) : NULL; |
| 551 | if (kind) | 550 | if (kind) |
| 552 | luaG_runerror(L, "attempt to %s %s `%s' (a %s value)", | 551 | luaG_runerror(L, "attempt to %s %s " LUA_SM " (a %s value)", |
| 553 | op, kind, name, t); | 552 | op, kind, name, t); |
| 554 | else | 553 | else |
| 555 | luaG_runerror(L, "attempt to %s a %s value", op, t); | 554 | luaG_runerror(L, "attempt to %s a %s value", op, t); |
