From 9d2e454d6f42f86faf645a4a24f66023846ea9ab Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 21 Dec 2001 15:30:31 -0200 Subject: BUG: seg. fault when rawget/rawset get extra arguments --- lbaselib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lbaselib.c') diff --git a/lbaselib.c b/lbaselib.c index 77656e12..cb914f18 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -185,7 +185,7 @@ static int luaB_globals (lua_State *L) { static int luaB_rawget (lua_State *L) { luaL_check_type(L, 1, LUA_TTABLE); luaL_check_any(L, 2); - lua_rawget(L, -2); + lua_rawget(L, 1); return 1; } @@ -193,7 +193,7 @@ static int luaB_rawset (lua_State *L) { luaL_check_type(L, 1, LUA_TTABLE); luaL_check_any(L, 2); luaL_check_any(L, 3); - lua_rawset(L, -3); + lua_rawset(L, 1); return 1; } @@ -449,7 +449,7 @@ static int luaB_foreachi (lua_State *L) { static int luaB_foreach (lua_State *L) { luaL_check_type(L, 1, LUA_TTABLE); luaL_check_type(L, 2, LUA_TFUNCTION); - lua_pushnil(L); /* first index */ + lua_pushnil(L); /* first key */ for (;;) { if (lua_next(L, 1) == 0) return 0; -- cgit v1.2.3-55-g6feb