aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-11-11 14:41:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-11-11 14:41:41 -0300
commitab1aca94e83d2eff1605ea1854df023c814cef21 (patch)
tree16b87253f000cb0052133bf2e1ede3d4b2b730ef /testes
parentd28265256110a0c5437247d443ddedc2a7aab116 (diff)
downloadlua-ab1aca94e83d2eff1605ea1854df023c814cef21.tar.gz
lua-ab1aca94e83d2eff1605ea1854df023c814cef21.tar.bz2
lua-ab1aca94e83d2eff1605ea1854df023c814cef21.zip
Removed optimization for «if ... then goto»
That optimization was too complex and caused some weird traces when debugging. The more common case «if ... then break» was kept.
Diffstat (limited to 'testes')
-rw-r--r--testes/code.lua22
1 files changed, 0 insertions, 22 deletions
diff --git a/testes/code.lua b/testes/code.lua
index 34b04668..1f971cd7 100644
--- a/testes/code.lua
+++ b/testes/code.lua
@@ -392,28 +392,6 @@ check(function (a, b)
392 end, 392 end,
393'TEST', 'JMP', 'TEST', 'JMP', 'ADDI', 'MMBINI', 'JMP', 'RETURN0') 393'TEST', 'JMP', 'TEST', 'JMP', 'ADDI', 'MMBINI', 'JMP', 'RETURN0')
394 394
395checkequal(
396function (a) while a < 10 do a = a + 1 end end,
397function (a)
398 ::loop::
399 if not (a < 10) then goto exit end
400 a = a + 1
401 goto loop
402::exit::
403end
404)
405
406checkequal(
407function (a) repeat local x = a + 1; a = x until a > 0 end,
408function (a)
409 ::loop:: do
410 local x = a + 1
411 a = x
412 end
413 if not (a > 0) then goto loop end
414end
415)
416
417checkequal(function () return 6 or true or nil end, 395checkequal(function () return 6 or true or nil end,
418 function () return k6 or kTrue or kNil end) 396 function () return k6 or kTrue or kNil end)
419 397