aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lparser.c b/lparser.c
index 3fae5419..b155ed53 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 1.86 2000/05/12 18:12:04 roberto Exp roberto $ 2** $Id: lparser.c,v 1.87 2000/05/15 19:48:04 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*/
@@ -626,12 +626,12 @@ static int listfields (LexState *ls) {
626 checklimit(ls, n, MAXARG_A*LFIELDS_PER_FLUSH, 626 checklimit(ls, n, MAXARG_A*LFIELDS_PER_FLUSH,
627 "items in a list initializer"); 627 "items in a list initializer");
628 if (++mod_n == LFIELDS_PER_FLUSH) { 628 if (++mod_n == LFIELDS_PER_FLUSH) {
629 luaK_code2(fs, OP_SETLIST, n/LFIELDS_PER_FLUSH - 1, LFIELDS_PER_FLUSH-1); 629 luaK_code2(fs, OP_SETLIST, n/LFIELDS_PER_FLUSH - 1, LFIELDS_PER_FLUSH);
630 mod_n = 0; 630 mod_n = 0;
631 } 631 }
632 } 632 }
633 if (mod_n > 0) 633 if (mod_n > 0)
634 luaK_code2(fs, OP_SETLIST, n/LFIELDS_PER_FLUSH, mod_n-1); 634 luaK_code2(fs, OP_SETLIST, n/LFIELDS_PER_FLUSH, mod_n);
635 return n; 635 return n;
636} 636}
637 637
@@ -911,12 +911,12 @@ static void repeatstat (LexState *ls, int line) {
911 911
912static void forbody (LexState *ls, OpCode prepfor, OpCode loopfor) { 912static void forbody (LexState *ls, OpCode prepfor, OpCode loopfor) {
913 FuncState *fs = ls->fs; 913 FuncState *fs = ls->fs;
914 int prep = luaK_code0(fs, prepfor); 914 int prep = luaK_code1(fs, prepfor, NO_JUMP);
915 int blockinit = luaK_getlabel(fs); 915 int blockinit = luaK_getlabel(fs);
916 check(ls, TK_DO); 916 check(ls, TK_DO);
917 block(ls); 917 block(ls);
918 luaK_patchlist(fs, prep, luaK_getlabel(fs)); 918 luaK_patchlist(fs, prep, luaK_getlabel(fs));
919 luaK_patchlist(fs, luaK_code0(fs, loopfor), blockinit); 919 luaK_patchlist(fs, luaK_code1(fs, loopfor, NO_JUMP), blockinit);
920} 920}
921 921
922 922