mirror of
https://github.com/lua/lua
synced 2024-11-22 21:01:26 +03:00
small bug: calls to upvalues were not correctly traced
This commit is contained in:
parent
a7c74c06b9
commit
ff4f8fe59a
26
ldblib.c
26
ldblib.c
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user