check C is independent from check B

This commit is contained in:
Roberto Ierusalimschy 2001-07-03 14:01:34 -03:00
parent 2a4afb97c8
commit 18d3e82cfe
1 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/* /*
** $Id: ldebug.c,v 1.85 2001/06/28 14:57:17 roberto Exp roberto $ ** $Id: ldebug.c,v 1.86 2001/06/28 19:58:57 roberto Exp roberto $
** Debug Interface ** Debug Interface
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -354,11 +354,11 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) {
case iABC: { case iABC: {
b = GETARG_B(i); b = GETARG_B(i);
c = GETARG_C(i); c = GETARG_C(i);
if (testOpMode(op, OpModeBreg)) { if (testOpMode(op, OpModeBreg))
checkreg(pt, b); checkreg(pt, b);
if (testOpMode(op, OpModeCreg))
check(c < pt->maxstacksize || check(c < pt->maxstacksize ||
(c >= MAXSTACK && c-MAXSTACK < pt->sizek)); (c >= MAXSTACK && c-MAXSTACK < pt->sizek));
}
break; break;
} }
case iABc: { case iABc: {
@ -397,7 +397,8 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) {
break; break;
} }
case OP_CONCAT: { case OP_CONCAT: {
check(b < c); /* at least two operands */ /* `c' is a register, and at least two operands */
check(c < MAXSTACK && b < c);
break; break;
} }
case OP_JMP: case OP_JMP: