This commit is contained in:
Roberto Ierusalimschy 2000-03-15 17:50:33 -03:00
parent f0b697e01c
commit 3860c5934e
3 changed files with 5 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/*
** $Id: lcode.c,v 1.10 2000/03/10 18:37:44 roberto Exp roberto $
** $Id: lcode.c,v 1.11 2000/03/13 20:37:16 roberto Exp roberto $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@ -37,7 +37,7 @@ static Instruction *previous_instruction (FuncState *fs) {
}
int luaK_primitivecode (FuncState *fs, Instruction i) {
static int luaK_primitivecode (FuncState *fs, Instruction i) {
luaM_growvector(fs->L, fs->f->code, fs->pc, 1, Instruction, codeEM, MAXARG_S);
fs->f->code[fs->pc] = i;
return fs->pc++;

View File

@ -1,5 +1,5 @@
/*
** $Id: lcode.h,v 1.6 2000/03/10 18:37:44 roberto Exp roberto $
** $Id: lcode.h,v 1.7 2000/03/13 20:37:16 roberto Exp roberto $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@ -20,7 +20,6 @@
void luaK_error (LexState *ls, const char *msg);
int luaK_primitivecode (FuncState *fs, Instruction i);
int luaK_code (FuncState *fs, Instruction i, int delta);
void luaK_retcode (FuncState *fs, int nlocals, int nexps);
void luaK_fixjump (FuncState *fs, int pc, int dest);

View File

@ -1,5 +1,5 @@
/*
** $Id: lparser.c,v 1.68 2000/03/10 18:37:44 roberto Exp roberto $
** $Id: lparser.c,v 1.69 2000/03/13 20:37:16 roberto Exp roberto $
** LL(1) Parser and code generator for Lua
** See Copyright Notice in lua.h
*/
@ -858,7 +858,7 @@ static void whilestat (LexState *ls, int line) {
luaK_fixjump(fs, while_init, cond_init);
/* correct `v' and copy condition to new position */
if (v.u.l.t != NO_JUMP) v.u.l.t += cond_init-while_init;
for (i=0; i<cond_size; i++) luaK_primitivecode(fs, buffer[i]);
for (i=0; i<cond_size; i++) luaK_code(fs, buffer[i], 0);
luaK_patchlist(fs, v.u.l.t, loopentry);
luaK_getlabel(fs); /* mark possible jump to this point */
}