mirror of
https://github.com/lua/lua
synced 2026-09-26 16:17:11 +03:00
Fixed buffers reuse absolute line information
This commit is contained in:
parent
12b6f610b0
commit
e7af9cdf0b
4 changed files with 36 additions and 13 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue