From 92f6e0c1bfb27cad95d99e99912e2e0c509dcc30 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 27 Feb 2003 08:52:30 -0300 Subject: no-nonsense debug information about tail calls --- lbaselib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lbaselib.c') diff --git a/lbaselib.c b/lbaselib.c index 7bf69c8f..9bb71492 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -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); } } -- cgit v1.2.3-55-g6feb