diff options
| -rw-r--r-- | lapi.c | 12 | ||||
| -rw-r--r-- | lstate.h | 3 |
2 files changed, 7 insertions, 8 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) |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstate.h,v 1.3 1997/11/26 20:28:22 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 1.4 1997/11/27 15:59:25 roberto Exp roberto $ |
| 3 | ** Global State | 3 | ** Global State |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -51,7 +51,6 @@ typedef struct LState { | |||
| 51 | TObject errorim; /* error tag method */ | 51 | TObject errorim; /* error tag method */ |
| 52 | struct C_Lua_Stack Cblocks[MAX_C_BLOCKS]; | 52 | struct C_Lua_Stack Cblocks[MAX_C_BLOCKS]; |
| 53 | int numCblocks; /* number of nested Cblocks */ | 53 | int numCblocks; /* number of nested Cblocks */ |
| 54 | TObject *functofind; /* auxiliar */ | ||
| 55 | GCnode rootproto; /* list of all prototypes */ | 54 | GCnode rootproto; /* list of all prototypes */ |
| 56 | GCnode rootcl; /* list of all closures */ | 55 | GCnode rootcl; /* list of all closures */ |
| 57 | GCnode roottable; /* list of all tables */ | 56 | GCnode roottable; /* list of all tables */ |
