diff options
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.9 1997/11/27 15:59:25 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.10 1997/11/27 18:25:14 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -463,16 +463,16 @@ void lua_funcinfo (lua_Object func, char **filename, int *linedefined) | |||
463 | 463 | ||
464 | static int checkfunc (TObject *o) | 464 | static int checkfunc (TObject *o) |
465 | { | 465 | { |
466 | return (o->ttype == LUA_T_FUNCTION) && | 466 | return o->ttype == LUA_T_FUNCTION && |
467 | ((L->functofind->ttype == LUA_T_FUNCTION) || | 467 | (ttype(L->stack.top) == LUA_T_FUNCTION || |
468 | (L->functofind->ttype == LUA_T_MARK)) && | 468 | ttype(L->stack.top) == LUA_T_MARK) && |
469 | (L->functofind->value.cl == o->value.cl); | 469 | clvalue(L->stack.top) == o->value.cl; |
470 | } | 470 | } |
471 | 471 | ||
472 | 472 | ||
473 | char *lua_getobjname (lua_Object o, char **name) | 473 | char *lua_getobjname (lua_Object o, char **name) |
474 | { /* try to find a name for given function */ | 474 | { /* try to find a name for given function */ |
475 | L->functofind = Address(o); | 475 | *(L->stack.top) = *Address(o); /* to be accessed by "checkfunc */ |
476 | if ((*name = luaT_travtagmethods(checkfunc)) != NULL) | 476 | if ((*name = luaT_travtagmethods(checkfunc)) != NULL) |
477 | return "tag-method"; | 477 | return "tag-method"; |
478 | else if ((*name = luaS_travsymbol(checkfunc)) != NULL) | 478 | else if ((*name = luaS_travsymbol(checkfunc)) != NULL) |