diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-02-15 12:28:46 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-02-15 12:28:46 -0300 |
commit | 1f3c6f4534c6411313361697d98d1145a1f030fa (patch) | |
tree | 4fe12910861bced95a9349e6aedb03097837939c /testes | |
parent | 25b143dd34fb587d1e35290c4b25bc08954800e2 (diff) | |
download | lua-1f3c6f4534c6411313361697d98d1145a1f030fa.tar.gz lua-1f3c6f4534c6411313361697d98d1145a1f030fa.tar.bz2 lua-1f3c6f4534c6411313361697d98d1145a1f030fa.zip |
Bug: Lua can generate wrong code when _ENV is <const>
Diffstat (limited to '')
-rw-r--r-- | testes/attrib.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/testes/attrib.lua b/testes/attrib.lua index b1076c76..83821c06 100644 --- a/testes/attrib.lua +++ b/testes/attrib.lua | |||
@@ -434,6 +434,16 @@ a.aVeryLongName012345678901234567890123456789012345678901234567890123456789 == | |||
434 | 10) | 434 | 10) |
435 | 435 | ||
436 | 436 | ||
437 | do | ||
438 | -- _ENV constant | ||
439 | local function foo () | ||
440 | local _ENV <const> = 11 | ||
441 | X = "hi" | ||
442 | end | ||
443 | local st, msg = pcall(foo) | ||
444 | assert(not st and string.find(msg, "number")) | ||
445 | end | ||
446 | |||
437 | 447 | ||
438 | -- test of large float/integer indices | 448 | -- test of large float/integer indices |
439 | 449 | ||