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

View File

@@ -726,6 +726,9 @@ assert(t.isvararg == false and t.nparams == 3 and t.nups == 0)
t = debug.getinfo(function (a,b,...) return t[a] end, "u")
assert(t.isvararg == true and t.nparams == 2 and t.nups == 1)
t = debug.getinfo(function (a,b,...t) t.n = 2; return t[a] end, "u")
assert(t.isvararg == true and t.nparams == 2 and t.nups == 0)
t = debug.getinfo(1) -- main
assert(t.isvararg == true and t.nparams == 0 and t.nups == 1 and
debug.getupvalue(t.func, 1) == "_ENV")