From e7af9cdf0b9fca080e8bb3463e16d60933e786f9 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 27 Dec 2023 17:42:00 -0300 Subject: Fixed buffers reuse absolute line information --- testes/api.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'testes') diff --git a/testes/api.lua b/testes/api.lua index 7d64cb22..85dadb69 100644 --- a/testes/api.lua +++ b/testes/api.lua @@ -551,6 +551,20 @@ do assert(m2 > m1 and m2 - m1 < 350) X = 0; code(); assert(X == N and Y == string.rep("a", N)) X = nil; Y = nil + + -- testing debug info in fixed buffers + source = {"X = 0"} + for i = 2, 300 do source[i] = "X = X + 1" end + source[#source + 1] = "X = X + {}" -- error in last line + source = table.concat(source, "\n") + source = load(source, "name1") + source = string.dump(source) + -- load dump using fixed buffer + local code = T.testC([[ + loadstring 2 name B; + return 1 + ]], source) + checkerr(":301:", code) -- correct line information end -- cgit v1.2.3-55-g6feb