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:
parent
2209f58e5d
commit
f02b75f826
|
@ -236,7 +236,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)
|
||||
|
@ -285,7 +285,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)
|
||||
|
|
Loading…
Reference in New Issue