"getobjname" checks first fallbacks (so, if a function is global and

a fallback, it is reported as a fallback).
This commit is contained in:
Roberto Ierusalimschy
1995-11-03 13:30:50 -02:00
parent 024f2374ab
commit 63b8a6fd20

View File

@@ -3,7 +3,7 @@
** Module to control static tables
*/
char *rcs_table="$Id: table.c,v 2.36 1995/10/23 13:53:48 roberto Exp roberto $";
char *rcs_table="$Id: table.c,v 2.37 1995/10/26 14:21:56 roberto Exp roberto $";
/*#include <string.h>*/
@@ -273,10 +273,10 @@ static int checkfunc (Object *o)
char *getobjname (lua_Object o, char **name)
{ /* try to find a name for given function */
functofind = luaI_Address(o);
if ((*name = lua_travsymbol(checkfunc)) != NULL)
return "global";
else if ((*name = luaI_travfallbacks(checkfunc)) != NULL)
if ((*name = luaI_travfallbacks(checkfunc)) != NULL)
return "fallback";
else if ((*name = lua_travsymbol(checkfunc)) != NULL)
return "global";
else return "";
}