diff --git a/bugs b/bugs index efff0bbe..a537f84e 100644 --- a/bugs +++ b/bugs @@ -743,3 +743,24 @@ patch = [[ ]], } + +Bug{ +what = [[rawset/rawget do not ignore extra arguments]], + +report = [[Romulo Bahiense, 11/03/2005]], + +example = [[ +a = {} +rawset(a, 1, 2, 3) +print(a[1], a[2]) -- should be 2 and nil +]], + +patch = [[ +* lbaselib.c: +175a176 +> lua_settop(L, 2); +183a185 +> lua_settop(L, 3); +]], +} + diff --git a/lbaselib.c b/lbaselib.c index 3936c5c7..442ca621 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.168 2005/02/23 17:30:22 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.169 2005/02/28 17:24:41 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -164,6 +164,7 @@ static int luaB_rawequal (lua_State *L) { static int luaB_rawget (lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); luaL_checkany(L, 2); + lua_settop(L, 2); lua_rawget(L, 1); return 1; } @@ -172,6 +173,7 @@ static int luaB_rawset (lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); luaL_checkany(L, 2); luaL_checkany(L, 3); + lua_settop(L, 3); lua_rawset(L, 1); return 1; }