Bug: Lua can generate wrong code when _ENV is <const>

This commit is contained in:
Roberto Ierusalimschy committed 2022-02-15 12:28:46 -03:00
1 parent 25b143dd34
commit 1f3c6f4534
2 files changed
+11

No files matched your search

+10
View File
@@ -434,6 +434,16 @@ a.aVeryLongName012345678901234567890123456789012345678901234567890123456789 ==
10)
do
-- _ENV constant
local function foo ()
local _ENV <const> = 11
X = "hi"
end
local st, msg = pcall(foo)
assert(not st and string.find(msg, "number"))
end
-- test of large float/integer indices