diff --git a/module/lua/ldo.c b/module/lua/ldo.c index b9368d9ce..24677596d 100644 --- a/module/lua/ldo.c +++ b/module/lua/ldo.c @@ -405,7 +405,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) { StkId base; Proto *p = clLvalue(func)->p; n = cast_int(L->top - func) - 1; /* number of real arguments */ - luaD_checkstack(L, p->maxstacksize); + luaD_checkstack(L, p->maxstacksize + p->numparams); for (; n < p->numparams; n++) setnilvalue(L->top++); /* complete missing arguments */ if (!p->is_vararg) {