From 4a3fd8488d617aa633f6b8be85e662653b100a59 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 3 Jun 2019 12:13:13 -0300 Subject: bug in 5.4 alpha rc1: to-be-closed x vararg functions Closing methods must be run before correcting 'ci->func' when exiting a vararg function, to get correct debug information (e.g., in case of errors). --- testes/locals.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'testes') diff --git a/testes/locals.lua b/testes/locals.lua index e59ab95a..7834d7da 100644 --- a/testes/locals.lua +++ b/testes/locals.lua @@ -276,6 +276,15 @@ do -- errors in __close assert(msg == 1) assert(log[1] == 4 and log[2] == 3 and log[3] == 2 and log[4] == 2 and #log == 4) + + -- error in toclose in vararg function + function foo (...) + local x123 = 10 + end + + local st, msg = pcall(foo) + assert(string.find(msg, "'x123'")) + end -- cgit v1.2.3-55-g6feb