Functions with vararg tables don't need hidden args.

Vararg functions with vararg tables don't use the arguments hidden in
the stack; therfore, it doesn't need to build/keep them.
This commit is contained in:
Roberto I
2025-11-28 15:12:51 -03:00
parent f33cc4ddec
commit a07f6a8241
9 changed files with 71 additions and 44 deletions

2
ldo.c
View File

@@ -487,7 +487,7 @@ static void rethook (lua_State *L, CallInfo *ci, int nres) {
int ftransfer;
if (isLua(ci)) {
Proto *p = ci_func(ci)->p;
if (p->flag & PF_ISVARARG)
if (p->flag & PF_VAHID)
delta = ci->u.l.nextraargs + p->numparams + 1;
}
ci->func.p += delta; /* if vararg, back to virtual 'func' */