]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: lua: remove some useless checks
authorThierry Fournier <tfournier@arpalert.org>
Mon, 22 Feb 2016 18:07:12 +0000 (19:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Mar 2016 13:42:50 +0000 (15:42 +0200)
The modified function are declared in the safe environment, so
they must called from safe environement. As the environement is
safe, its useles to check the stack size.

src/hlua_fcn.c

index c649aece6eb9af668c87c327b034a7c2dbf61288..f9e13918abcf8cb7d3821514d7d52f6bc336de03 100644 (file)
@@ -35,24 +35,18 @@ static int class_concat_ref;
  */
 void hlua_class_const_int(lua_State *L, const char *name, int value)
 {
-       if (!lua_checkstack(L, 2))
-               luaL_error(L, "full stack");
        lua_pushstring(L, name);
        lua_pushinteger(L, value);
        lua_rawset(L, -3);
 }
 void hlua_class_const_str(lua_State *L, const char *name, const char *value)
 {
-       if (!lua_checkstack(L, 2))
-               luaL_error(L, "full stack");
        lua_pushstring(L, name);
        lua_pushstring(L, value);
        lua_rawset(L, -3);
 }
 void hlua_class_function(lua_State *L, const char *name, int (*function)(lua_State *L))
 {
-       if (!lua_checkstack(L, 2))
-               luaL_error(L, "full stack");
        lua_pushstring(L, name);
        lua_pushcclosure(L, function, 0);
        lua_rawset(L, -3);