aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2025-11-28 15:12:51 -0300
committerRoberto I <roberto@inf.puc-rio.br>2025-11-28 15:12:51 -0300
commita07f6a824197d7dc01c321599d3bc71936a2590e (patch)
treea3c4c0aff91e4175c31806727190803f250bf3e6 /testes
parentf33cc4ddec886ea499d7d41dd60cac5ddc5687db (diff)
downloadlua-a07f6a824197d7dc01c321599d3bc71936a2590e.tar.gz
lua-a07f6a824197d7dc01c321599d3bc71936a2590e.tar.bz2
lua-a07f6a824197d7dc01c321599d3bc71936a2590e.zip
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.
Diffstat (limited to 'testes')
-rw-r--r--testes/db.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/testes/db.lua b/testes/db.lua
index 4220b68b..e15a5be6 100644
--- a/testes/db.lua
+++ b/testes/db.lua
@@ -726,6 +726,9 @@ assert(t.isvararg == false and t.nparams == 3 and t.nups == 0)
726t = debug.getinfo(function (a,b,...) return t[a] end, "u") 726t = debug.getinfo(function (a,b,...) return t[a] end, "u")
727assert(t.isvararg == true and t.nparams == 2 and t.nups == 1) 727assert(t.isvararg == true and t.nparams == 2 and t.nups == 1)
728 728
729t = debug.getinfo(function (a,b,...t) t.n = 2; return t[a] end, "u")
730assert(t.isvararg == true and t.nparams == 2 and t.nups == 0)
731
729t = debug.getinfo(1) -- main 732t = debug.getinfo(1) -- main
730assert(t.isvararg == true and t.nparams == 0 and t.nups == 1 and 733assert(t.isvararg == true and t.nparams == 0 and t.nups == 1 and
731 debug.getupvalue(t.func, 1) == "_ENV") 734 debug.getupvalue(t.func, 1) == "_ENV")