diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-12-22 13:52:53 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-12-22 13:52:53 -0300 |
commit | 7d4c7ae2af686df4a9f3cc0c6110986d886d55e6 (patch) | |
tree | 19c504432ef6a8631749783fda1b6622296a5a72 /testes/files.lua | |
parent | 873588dc5f04bfc37006c3dc6ceb9a495ea503f2 (diff) | |
download | lua-7d4c7ae2af686df4a9f3cc0c6110986d886d55e6.tar.gz lua-7d4c7ae2af686df4a9f3cc0c6110986d886d55e6.tar.bz2 lua-7d4c7ae2af686df4a9f3cc0c6110986d886d55e6.zip |
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.
Diffstat (limited to 'testes/files.lua')
-rw-r--r-- | testes/files.lua | 4 |
1 files changed, 2 insertions, 2 deletions
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 | |||
427 | -- get the to-be-closed variable from a loop | 427 | -- get the to-be-closed variable from a loop |
428 | local function gettoclose (lv) | 428 | local function gettoclose (lv) |
429 | lv = lv + 1 | 429 | lv = lv + 1 |
430 | local stvar = 0 -- to-be-closed is 4th state variable in the loop | 430 | local stvar = 0 -- to-be-closed is 3th state variable in the loop |
431 | for i = 1, 1000 do | 431 | for i = 1, 1000 do |
432 | local n, v = debug.getlocal(lv, i) | 432 | local n, v = debug.getlocal(lv, i) |
433 | if n == "(for state)" then | 433 | if n == "(for state)" then |
434 | stvar = stvar + 1 | 434 | stvar = stvar + 1 |
435 | if stvar == 4 then return v end | 435 | if stvar == 3 then return v end |
436 | end | 436 | end |
437 | end | 437 | end |
438 | end | 438 | end |