no-nonsense debug information about tail calls

This commit is contained in:
Roberto Ierusalimschy
2003-02-27 08:52:30 -03:00
parent 5cd99b82b7
commit 92f6e0c1bf
7 changed files with 102 additions and 74 deletions

View File

@@ -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);
}
}