aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-03-15 17:50:33 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-03-15 17:50:33 -0300
commit3860c5934e0f61bfd4c3b91edfb6223f938d8008 (patch)
tree6b02c6dcc68ab51eb3eb7dde2e22f99e657e8ca2
parentf0b697e01caf626785cd9572f82fe98c4a3889fd (diff)
downloadlua-3860c5934e0f61bfd4c3b91edfb6223f938d8008.tar.gz
lua-3860c5934e0f61bfd4c3b91edfb6223f938d8008.tar.bz2
lua-3860c5934e0f61bfd4c3b91edfb6223f938d8008.zip
details.
-rw-r--r--lcode.c4
-rw-r--r--lcode.h3
-rw-r--r--lparser.c4
3 files changed, 5 insertions, 6 deletions
diff --git a/lcode.c b/lcode.c
index c5602397..b4d52e65 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 1.10 2000/03/10 18:37:44 roberto Exp roberto $ 2** $Id: lcode.c,v 1.11 2000/03/13 20:37:16 roberto Exp roberto $
3** Code generator for Lua 3** Code generator for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -37,7 +37,7 @@ static Instruction *previous_instruction (FuncState *fs) {
37} 37}
38 38
39 39
40int luaK_primitivecode (FuncState *fs, Instruction i) { 40static int luaK_primitivecode (FuncState *fs, Instruction i) {
41 luaM_growvector(fs->L, fs->f->code, fs->pc, 1, Instruction, codeEM, MAXARG_S); 41 luaM_growvector(fs->L, fs->f->code, fs->pc, 1, Instruction, codeEM, MAXARG_S);
42 fs->f->code[fs->pc] = i; 42 fs->f->code[fs->pc] = i;
43 return fs->pc++; 43 return fs->pc++;
diff --git a/lcode.h b/lcode.h
index 9d168d29..61c574cc 100644
--- a/lcode.h
+++ b/lcode.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.h,v 1.6 2000/03/10 18:37:44 roberto Exp roberto $ 2** $Id: lcode.h,v 1.7 2000/03/13 20:37:16 roberto Exp roberto $
3** Code generator for Lua 3** Code generator for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -20,7 +20,6 @@
20 20
21 21
22void luaK_error (LexState *ls, const char *msg); 22void luaK_error (LexState *ls, const char *msg);
23int luaK_primitivecode (FuncState *fs, Instruction i);
24int luaK_code (FuncState *fs, Instruction i, int delta); 23int luaK_code (FuncState *fs, Instruction i, int delta);
25void luaK_retcode (FuncState *fs, int nlocals, int nexps); 24void luaK_retcode (FuncState *fs, int nlocals, int nexps);
26void luaK_fixjump (FuncState *fs, int pc, int dest); 25void luaK_fixjump (FuncState *fs, int pc, int dest);
diff --git a/lparser.c b/lparser.c
index 2e9912a3..5e8157f2 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 1.68 2000/03/10 18:37:44 roberto Exp roberto $ 2** $Id: lparser.c,v 1.69 2000/03/13 20:37:16 roberto Exp roberto $
3** LL(1) Parser and code generator for Lua 3** LL(1) Parser and code generator for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -858,7 +858,7 @@ static void whilestat (LexState *ls, int line) {
858 luaK_fixjump(fs, while_init, cond_init); 858 luaK_fixjump(fs, while_init, cond_init);
859 /* correct `v' and copy condition to new position */ 859 /* correct `v' and copy condition to new position */
860 if (v.u.l.t != NO_JUMP) v.u.l.t += cond_init-while_init; 860 if (v.u.l.t != NO_JUMP) v.u.l.t += cond_init-while_init;
861 for (i=0; i<cond_size; i++) luaK_primitivecode(fs, buffer[i]); 861 for (i=0; i<cond_size; i++) luaK_code(fs, buffer[i], 0);
862 luaK_patchlist(fs, v.u.l.t, loopentry); 862 luaK_patchlist(fs, v.u.l.t, loopentry);
863 luaK_getlabel(fs); /* mark possible jump to this point */ 863 luaK_getlabel(fs); /* mark possible jump to this point */
864} 864}