aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-08-17 12:37:04 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-08-17 12:47:28 -0300
commit8b752ddf14c1987411906d07a8c68f72f168b9b7 (patch)
tree6fe4b16cae918d5531697ea2a10e60dea982f5bc /testes
parent1bf4b80f1ace8384eb9dd6f7f8b67256b3944a7a (diff)
downloadlua-8b752ddf14c1987411906d07a8c68f72f168b9b7.tar.gz
lua-8b752ddf14c1987411906d07a8c68f72f168b9b7.tar.bz2
lua-8b752ddf14c1987411906d07a8c68f72f168b9b7.zip
Bug: wrong code gen. for indices with comparisons
In function 'luaK_exp2val', used to generate code for indices: Macro 'hasjumps' does not consider the case when the whole expression is a "jump" (a test). In all other of its uses, the surrounding code ensures that the expression cannot be VJMP.
Diffstat (limited to 'testes')
-rw-r--r--testes/closure.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/testes/closure.lua b/testes/closure.lua
index de1b54ec..07149ef3 100644
--- a/testes/closure.lua
+++ b/testes/closure.lua
@@ -3,6 +3,14 @@
3 3
4print "testing closures" 4print "testing closures"
5 5
6do -- bug in 5.4.7
7 _ENV[true] = 10
8 local function aux () return _ENV[1 < 2] end
9 assert(aux() == 10)
10 _ENV[true] = nil
11end
12
13
6local A,B = 0,{g=10} 14local A,B = 0,{g=10}
7local function f(x) 15local function f(x)
8 local a = {} 16 local a = {}