diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-19 10:53:18 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-19 10:53:18 -0300 |
commit | 9b37a4695ebf50b37b5b4fb279ae948f23b5b6a0 (patch) | |
tree | 2a6b0f6c1c2eb962bb383175eb0a67ea81a4564d /testes/db.lua | |
parent | 1e0c73d5b643707335b06abd2546a83d9439d14c (diff) | |
download | lua-9b37a4695ebf50b37b5b4fb279ae948f23b5b6a0.tar.gz lua-9b37a4695ebf50b37b5b4fb279ae948f23b5b6a0.tar.bz2 lua-9b37a4695ebf50b37b5b4fb279ae948f23b5b6a0.zip |
New semantics for the integer 'for' loop
The numerical 'for' loop over integers now uses a precomputed counter
to control its number of iteractions. This change eliminates several
weird cases caused by overflows (wrap-around) in the control variable.
(It also ensures that every integer loop halts.)
Also, the special opcodes for the usual case of step==1 were removed.
(The new code is already somewhat complex for the usual case,
but efficient.)
Diffstat (limited to 'testes/db.lua')
-rw-r--r-- | testes/db.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testes/db.lua b/testes/db.lua index 976962b0..0858dd20 100644 --- a/testes/db.lua +++ b/testes/db.lua | |||
@@ -162,7 +162,7 @@ test([[for i,v in pairs{'a','b'} do | |||
162 | end | 162 | end |
163 | ]], {1,2,1,2,1,3}) | 163 | ]], {1,2,1,2,1,3}) |
164 | 164 | ||
165 | test([[for i=1,4 do a=1 end]], {1,1,1,1,1}) | 165 | test([[for i=1,4 do a=1 end]], {1,1,1,1}, true) |
166 | 166 | ||
167 | 167 | ||
168 | do -- testing line info/trace with large gaps in source | 168 | do -- testing line info/trace with large gaps in source |