Fix arguments to luaL_checkstack()

The argument to luaL_checkstack() is the amount of new stack to make available,
not the new size of the stack. Thus, remove the addition of lua_gettop(L) here.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-02-17 19:07:06 +01:00
parent 333cfaf0a5
commit 89a29b5404
1 changed files with 2 additions and 2 deletions

View File

@ -218,7 +218,7 @@ signal_object_emit(lua_State *L, signal_array_t *arr, const char *name, int narg
if(sigfound)
{
int nbfunc = sigfound->sigfuncs.len;
luaL_checkstack(L, lua_gettop(L) + nbfunc + nargs + 1, "too much signal");
luaL_checkstack(L, nbfunc + nargs + 1, "too much signal");
/* Push all functions and then execute, because this list can change
* while executing funcs. */
foreach(func, sigfound->sigfuncs)
@ -263,7 +263,7 @@ luaA_object_emit_signal(lua_State *L, int oud,
if(sigfound)
{
int nbfunc = sigfound->sigfuncs.len;
luaL_checkstack(L, lua_gettop(L) + nbfunc + nargs + 2, "too much signal");
luaL_checkstack(L, nbfunc + nargs + 2, "too much signal");
/* Push all functions and then execute, because this list can change
* while executing funcs. */
foreach(func, sigfound->sigfuncs)