summaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-12-21 15:30:31 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-12-21 15:30:31 -0200
commit9d2e454d6f42f86faf645a4a24f66023846ea9ab (patch)
treefd77170dc472eeb7f4b9d750933ca0700d5e6ad6 /lbaselib.c
parent09e15692f3a237e2858cc67e2e7f07c3e4c983e7 (diff)
downloadlua-9d2e454d6f42f86faf645a4a24f66023846ea9ab.tar.gz
lua-9d2e454d6f42f86faf645a4a24f66023846ea9ab.tar.bz2
lua-9d2e454d6f42f86faf645a4a24f66023846ea9ab.zip
BUG: seg. fault when rawget/rawset get extra arguments
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c6
1 files changed, 3 insertions, 3 deletions
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) {
185static int luaB_rawget (lua_State *L) { 185static int luaB_rawget (lua_State *L) {
186 luaL_check_type(L, 1, LUA_TTABLE); 186 luaL_check_type(L, 1, LUA_TTABLE);
187 luaL_check_any(L, 2); 187 luaL_check_any(L, 2);
188 lua_rawget(L, -2); 188 lua_rawget(L, 1);
189 return 1; 189 return 1;
190} 190}
191 191
@@ -193,7 +193,7 @@ static int luaB_rawset (lua_State *L) {
193 luaL_check_type(L, 1, LUA_TTABLE); 193 luaL_check_type(L, 1, LUA_TTABLE);
194 luaL_check_any(L, 2); 194 luaL_check_any(L, 2);
195 luaL_check_any(L, 3); 195 luaL_check_any(L, 3);
196 lua_rawset(L, -3); 196 lua_rawset(L, 1);
197 return 1; 197 return 1;
198} 198}
199 199
@@ -449,7 +449,7 @@ static int luaB_foreachi (lua_State *L) {
449static int luaB_foreach (lua_State *L) { 449static int luaB_foreach (lua_State *L) {
450 luaL_check_type(L, 1, LUA_TTABLE); 450 luaL_check_type(L, 1, LUA_TTABLE);
451 luaL_check_type(L, 2, LUA_TFUNCTION); 451 luaL_check_type(L, 2, LUA_TFUNCTION);
452 lua_pushnil(L); /* first index */ 452 lua_pushnil(L); /* first key */
453 for (;;) { 453 for (;;) {
454 if (lua_next(L, 1) == 0) 454 if (lua_next(L, 1) == 0)
455 return 0; 455 return 0;