aboutsummaryrefslogtreecommitdiff
path: root/ljumptab.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-03-19 10:53:18 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-03-19 10:53:18 -0300
commit9b37a4695ebf50b37b5b4fb279ae948f23b5b6a0 (patch)
tree2a6b0f6c1c2eb962bb383175eb0a67ea81a4564d /ljumptab.h
parent1e0c73d5b643707335b06abd2546a83d9439d14c (diff)
downloadlua-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 'ljumptab.h')
-rw-r--r--ljumptab.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/ljumptab.h b/ljumptab.h
index 9fa72a73..fa4277cc 100644
--- a/ljumptab.h
+++ b/ljumptab.h
@@ -99,8 +99,6 @@ static void *disptab[NUM_OPCODES] = {
99&&L_OP_RETURN, 99&&L_OP_RETURN,
100&&L_OP_RETURN0, 100&&L_OP_RETURN0,
101&&L_OP_RETURN1, 101&&L_OP_RETURN1,
102&&L_OP_FORLOOP1,
103&&L_OP_FORPREP1,
104&&L_OP_FORLOOP, 102&&L_OP_FORLOOP,
105&&L_OP_FORPREP, 103&&L_OP_FORPREP,
106&&L_OP_TFORPREP, 104&&L_OP_TFORPREP,