mirror of https://github.com/rusefi/lua.git
cannot jump to a setlist count
This commit is contained in:
parent
f1c2dd3aed
commit
5cb6037d49
10
ldebug.c
10
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue