generic for also coded to make test at the end of the loop

This commit is contained in:
Roberto Ierusalimschy
2002-05-13 10:09:00 -03:00
parent b55fded18c
commit af19d55635
5 changed files with 36 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: ldebug.c,v 1.112 2002/05/07 17:36:56 roberto Exp roberto $
** $Id: ldebug.c,v 1.113 2002/05/09 14:14:34 roberto Exp roberto $
** Debug Interface
** See Copyright Notice in lua.h
*/
@@ -336,6 +336,9 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) {
check(c < MAXSTACK && b < c);
break;
}
case OP_TFORLOOP:
checkreg(pt, a+2+c);
/* go through */
case OP_FORLOOP:
checkreg(pt, a+2);
/* go through */
@@ -347,11 +350,6 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) {
pc += b; /* do the jump */
break;
}
case OP_TFORLOOP: {
checkreg(pt, a+2+c);
check(pc+2 < pt->sizecode); /* check skip */
break;
}
case OP_CALL: {
if (b != 0) {
checkreg(pt, a+b-1);