diff options
| author | Roberto I <roberto@inf.puc-rio.br> | 2025-11-28 15:12:51 -0300 |
|---|---|---|
| committer | Roberto I <roberto@inf.puc-rio.br> | 2025-11-28 15:12:51 -0300 |
| commit | a07f6a824197d7dc01c321599d3bc71936a2590e (patch) | |
| tree | a3c4c0aff91e4175c31806727190803f250bf3e6 /testes | |
| parent | f33cc4ddec886ea499d7d41dd60cac5ddc5687db (diff) | |
| download | lua-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.lua | 3 |
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) | |||
| 726 | t = debug.getinfo(function (a,b,...) return t[a] end, "u") | 726 | t = debug.getinfo(function (a,b,...) return t[a] end, "u") |
| 727 | assert(t.isvararg == true and t.nparams == 2 and t.nups == 1) | 727 | assert(t.isvararg == true and t.nparams == 2 and t.nups == 1) |
| 728 | 728 | ||
| 729 | t = debug.getinfo(function (a,b,...t) t.n = 2; return t[a] end, "u") | ||
| 730 | assert(t.isvararg == true and t.nparams == 2 and t.nups == 0) | ||
| 731 | |||
| 729 | t = debug.getinfo(1) -- main | 732 | t = debug.getinfo(1) -- main |
| 730 | assert(t.isvararg == true and t.nparams == 0 and t.nups == 1 and | 733 | assert(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") |
