commit 5cb6037d49cbbde936505a705e37d4962c91b28a
parent f1c2dd3aed116167d0de8c237fd456f11fdd7172
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Thu, 7 Oct 2004 14:26:38 -0300
cannot jump to a setlist count
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/ldebug.c b/ldebug.c
@@ -1,5 +1,5 @@
/*
-** $Id: ldebug.c,v 2.8 2004/09/01 13:47:31 roberto Exp $
+** $Id: ldebug.c,v 2.9 2004/10/04 19:04:34 roberto Exp roberto $
** Debug Interface
** See Copyright Notice in lua.h
*/
@@ -315,6 +315,11 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) {
if (getBMode(op) == OpArgR) {
int dest = pc+1+b;
check(0 <= dest && dest < pt->sizecode);
+ if (dest > 0) {
+ /* cannot jump to a setlist count */
+ const Instruction d = pt->code[dest-1];
+ check(!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0));
+ }
}
break;
}
@@ -356,7 +361,8 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) {
break;
}
case OP_TFORLOOP: {
- checkreg(pt, a+5); /* space for control variables */
+ check(c >= 1); /* at least one result (control variable) */
+ checkreg(pt, a+3+c); /* space for results */
if (reg >= a+3) last = pc; /* affect all regs above its call base */
break;
}