tag methods are always functions, so don't need to store a whole object

This commit is contained in:
Roberto Ierusalimschy
2000-10-05 10:00:17 -03:00
parent 001f2bdd0e
commit 046a3d6173
10 changed files with 159 additions and 130 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: ldebug.c,v 1.43 2000/10/02 20:10:55 roberto Exp roberto $
** $Id: ldebug.c,v 1.44 2000/10/05 12:14:08 roberto Exp roberto $
** Debug Interface
** See Copyright Notice in lua.h
*/
@@ -203,12 +203,14 @@ static void lua_funcinfo (lua_State *L, lua_Debug *ar, StkId func) {
static const char *travtagmethods (lua_State *L, const TObject *o) {
int e;
for (e=0; e<IM_N; e++) {
int t;
for (t=0; t<=L->last_tag; t++)
if (luaO_equalObj(o, luaT_getim(L, t,e)))
return luaT_eventname[e];
if (ttype(o) == LUA_TFUNCTION) {
int e;
for (e=0; e<TM_N; e++) {
int t;
for (t=0; t<=L->last_tag; t++)
if (clvalue(o) == luaT_gettm(L, t, e))
return luaT_eventname[e];
}
}
return NULL;
}