From 7d4c7ae2af686df4a9f3cc0c6110986d886d55e6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 22 Dec 2022 13:52:53 -0300 Subject: Changes in opcodes for generic 'for' Again, as the control variable is read only, the code doesn't need to keep an internal copy of it. --- testes/files.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'testes/files.lua') diff --git a/testes/files.lua b/testes/files.lua index 78f962e5..599644f3 100644 --- a/testes/files.lua +++ b/testes/files.lua @@ -427,12 +427,12 @@ do -- testing closing file in line iteration -- get the to-be-closed variable from a loop local function gettoclose (lv) lv = lv + 1 - local stvar = 0 -- to-be-closed is 4th state variable in the loop + local stvar = 0 -- to-be-closed is 3th state variable in the loop for i = 1, 1000 do local n, v = debug.getlocal(lv, i) if n == "(for state)" then stvar = stvar + 1 - if stvar == 4 then return v end + if stvar == 3 then return v end end end end -- cgit v1.2.3-55-g6feb