aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-02-05 20:39:12 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-02-05 20:39:12 -0200
commit38b0e6128da7796300e2e8621e87835e16539f5b (patch)
tree5b0a7ad2b0fb850d47f0566fd06b8cda013bbc8b /lcode.c
parentaddbe8c8b0587fd316f33fb013034e035f9217ed (diff)
downloadlua-38b0e6128da7796300e2e8621e87835e16539f5b.tar.gz
lua-38b0e6128da7796300e2e8621e87835e16539f5b.tar.bz2
lua-38b0e6128da7796300e2e8621e87835e16539f5b.zip
simpler implementation for `for' loops
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/lcode.c b/lcode.c
index b8a4ed19..c50596fb 100644
--- a/lcode.c
+++ b/lcode.c
@@ -77,17 +77,6 @@ static void luaK_fixjump (FuncState *fs, int pc, int dest) {
77 77
78 78
79/* 79/*
80** prep-for instructions (OP_FORPREP & OP_TFORPREP) have a negated jump,
81** as they simulate the real jump...
82*/
83void luaK_fixfor (FuncState *fs, int pc, int dest) {
84 Instruction *jmp = &fs->f->code[pc];
85 int offset = dest-(pc+1);
86 SETARG_sBc(*jmp, -offset);
87}
88
89
90/*
91** returns current `pc' and marks it as a jump target (to avoid wrong 80** returns current `pc' and marks it as a jump target (to avoid wrong
92** optimizations with consecutive instructions not in the same basic block). 81** optimizations with consecutive instructions not in the same basic block).
93** discharge list of jumps to last target. 82** discharge list of jumps to last target.