small bug: calls to upvalues were not correctly traced

This commit is contained in:
Roberto Ierusalimschy 2004-08-13 15:02:36 -03:00
parent a7c74c06b9
commit ff4f8fe59a

View File

@ -1,5 +1,5 @@
/* /*
** $Id: ldblib.c,v 1.85 2004/04/30 20:13:38 roberto Exp roberto $ ** $Id: ldblib.c,v 1.86 2004/05/31 19:27:14 roberto Exp roberto $
** Interface from Lua to its debug API ** Interface from Lua to its debug API
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -303,22 +303,16 @@ static int errorfb (lua_State *L) {
lua_pushfstring(L, "%s:", ar.short_src); lua_pushfstring(L, "%s:", ar.short_src);
if (ar.currentline > 0) if (ar.currentline > 0)
lua_pushfstring(L, "%d:", ar.currentline); lua_pushfstring(L, "%d:", ar.currentline);
switch (*ar.namewhat) { if (*ar.namewhat != '\0') /* is there a name? */
case 'g': /* global */
case 'l': /* local */
case 'f': /* field */
case 'm': /* method */
lua_pushfstring(L, " in function `%s'", ar.name); lua_pushfstring(L, " in function `%s'", ar.name);
break; else {
default: { if (*ar.what == 'm') /* main? */
if (*ar.what == 'm') /* main? */ lua_pushfstring(L, " in main chunk");
lua_pushfstring(L, " in main chunk"); else if (*ar.what == 'C' || *ar.what == 't')
else if (*ar.what == 'C' || *ar.what == 't') lua_pushliteral(L, " ?"); /* C function or tail call */
lua_pushliteral(L, " ?"); /* C function or tail call */ else
else lua_pushfstring(L, " in function <%s:%d>",
lua_pushfstring(L, " in function <%s:%d>", ar.short_src, ar.linedefined);
ar.short_src, ar.linedefined);
}
} }
lua_concat(L, lua_gettop(L) - arg); lua_concat(L, lua_gettop(L) - arg);
} }