no-nonsense debug information about tail calls
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lbaselib.c,v 1.122 2003/02/24 16:50:41 roberto Exp roberto $
|
||||
** $Id: lbaselib.c,v 1.123 2003/02/24 16:54:20 roberto Exp roberto $
|
||||
** Basic library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -123,6 +123,9 @@ static void getfunc (lua_State *L) {
|
||||
if (lua_getstack(L, level, &ar) == 0)
|
||||
luaL_argerror(L, 1, "invalid level");
|
||||
lua_getinfo(L, "f", &ar);
|
||||
if (lua_isnil(L, -1))
|
||||
luaL_error(L, "cannot get/set environment (tail call at level %d)",
|
||||
level);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user