store "functofind" in stack top, so doesn't need this field in
global state.
This commit is contained in:
12
lapi.c
12
lapi.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lapi.c,v 1.9 1997/11/27 15:59:25 roberto Exp roberto $
|
** $Id: lapi.c,v 1.10 1997/11/27 18:25:14 roberto Exp roberto $
|
||||||
** Lua API
|
** Lua API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -463,16 +463,16 @@ void lua_funcinfo (lua_Object func, char **filename, int *linedefined)
|
|||||||
|
|
||||||
static int checkfunc (TObject *o)
|
static int checkfunc (TObject *o)
|
||||||
{
|
{
|
||||||
return (o->ttype == LUA_T_FUNCTION) &&
|
return o->ttype == LUA_T_FUNCTION &&
|
||||||
((L->functofind->ttype == LUA_T_FUNCTION) ||
|
(ttype(L->stack.top) == LUA_T_FUNCTION ||
|
||||||
(L->functofind->ttype == LUA_T_MARK)) &&
|
ttype(L->stack.top) == LUA_T_MARK) &&
|
||||||
(L->functofind->value.cl == o->value.cl);
|
clvalue(L->stack.top) == o->value.cl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *lua_getobjname (lua_Object o, char **name)
|
char *lua_getobjname (lua_Object o, char **name)
|
||||||
{ /* try to find a name for given function */
|
{ /* try to find a name for given function */
|
||||||
L->functofind = Address(o);
|
*(L->stack.top) = *Address(o); /* to be accessed by "checkfunc */
|
||||||
if ((*name = luaT_travtagmethods(checkfunc)) != NULL)
|
if ((*name = luaT_travtagmethods(checkfunc)) != NULL)
|
||||||
return "tag-method";
|
return "tag-method";
|
||||||
else if ((*name = luaS_travsymbol(checkfunc)) != NULL)
|
else if ((*name = luaS_travsymbol(checkfunc)) != NULL)
|
||||||
|
|||||||
3
lstate.h
3
lstate.h
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lstate.h,v 1.3 1997/11/26 20:28:22 roberto Exp roberto $
|
** $Id: lstate.h,v 1.4 1997/11/27 15:59:25 roberto Exp roberto $
|
||||||
** Global State
|
** Global State
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -51,7 +51,6 @@ typedef struct LState {
|
|||||||
TObject errorim; /* error tag method */
|
TObject errorim; /* error tag method */
|
||||||
struct C_Lua_Stack Cblocks[MAX_C_BLOCKS];
|
struct C_Lua_Stack Cblocks[MAX_C_BLOCKS];
|
||||||
int numCblocks; /* number of nested Cblocks */
|
int numCblocks; /* number of nested Cblocks */
|
||||||
TObject *functofind; /* auxiliar */
|
|
||||||
GCnode rootproto; /* list of all prototypes */
|
GCnode rootproto; /* list of all prototypes */
|
||||||
GCnode rootcl; /* list of all closures */
|
GCnode rootcl; /* list of all closures */
|
||||||
GCnode roottable; /* list of all tables */
|
GCnode roottable; /* list of all tables */
|
||||||
|
|||||||
Reference in New Issue
Block a user