diff options
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.122 2003/02/24 16:50:41 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.123 2003/02/24 16:54:20 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -123,6 +123,9 @@ static void getfunc (lua_State *L) { | |||
123 | if (lua_getstack(L, level, &ar) == 0) | 123 | if (lua_getstack(L, level, &ar) == 0) |
124 | luaL_argerror(L, 1, "invalid level"); | 124 | luaL_argerror(L, 1, "invalid level"); |
125 | lua_getinfo(L, "f", &ar); | 125 | lua_getinfo(L, "f", &ar); |
126 | if (lua_isnil(L, -1)) | ||
127 | luaL_error(L, "cannot get/set environment (tail call at level %d)", | ||
128 | level); | ||
126 | } | 129 | } |
127 | } | 130 | } |
128 | 131 | ||