From ab1aca94e83d2eff1605ea1854df023c814cef21 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 11 Nov 2020 14:41:41 -0300 Subject: Removed optimization for «if ... then goto» MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That optimization was too complex and caused some weird traces when debugging. The more common case «if ... then break» was kept. --- testes/code.lua | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'testes') 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) end, 'TEST', 'JMP', 'TEST', 'JMP', 'ADDI', 'MMBINI', 'JMP', 'RETURN0') -checkequal( -function (a) while a < 10 do a = a + 1 end end, -function (a) - ::loop:: - if not (a < 10) then goto exit end - a = a + 1 - goto loop -::exit:: -end -) - -checkequal( -function (a) repeat local x = a + 1; a = x until a > 0 end, -function (a) - ::loop:: do - local x = a + 1 - a = x - end - if not (a > 0) then goto loop end -end -) - checkequal(function () return 6 or true or nil end, function () return k6 or kTrue or kNil end) -- cgit v1.2.3-55-g6feb