From: Rui Guo Date: Fri, 12 Jun 2009 08:37:54 +0000 (+0800) Subject: Fix lua stack balance in LuaHRef(). And get rid of an unused var. X-Git-Url: https://repo.or.cz/w/screen-lua.git/commitdiff_plain/fb9a16d3eef1c0c8f44134a01196c2955ba046cd Fix lua stack balance in LuaHRef(). And get rid of an unused var. --- diff --git a/src/lua.c b/src/lua.c index 496e7bb..1c710f7 100644 --- a/src/lua.c +++ b/src/lua.c @@ -953,7 +953,7 @@ LuaHRef(lua_State *L, int key, int reg) lua_pushinteger(L, reg? cnt + 1 : cnt - 1); lua_settable(L, funckey); /*htable[key] = cnt + 1*/ } - lua_pop(L, 3); + lua_pop(L, 5); } void @@ -991,7 +991,7 @@ LuaHGetName(lua_State *L, lua_handler key) lua_handler LuaCheckHandler(lua_State *L, int idx, int reg) { - int name = 0, key, sc; + int name = 0, key; if (lua_isstring(L, idx)) { const char * handler; @@ -1005,7 +1005,6 @@ LuaCheckHandler(lua_State *L, int idx, int reg) else if (!lua_isfunction(L, idx)) luaL_error(L, "Handler should be a function or the name of function"); - sc = lua_gettop(L); key = LuaFuncKey(L, idx ); LuaHRef(L, key, reg); if (name)