aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-10-07 14:27:00 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-10-07 14:27:00 -0300
commit5cb6037d49cbbde936505a705e37d4962c91b28a (patch)
tree6439f312f20c9c52dd4e14cfda2acd237fc45300
parentf1c2dd3aed116167d0de8c237fd456f11fdd7172 (diff)
downloadlua-5cb6037d49cbbde936505a705e37d4962c91b28a.tar.gz
lua-5cb6037d49cbbde936505a705e37d4962c91b28a.tar.bz2
lua-5cb6037d49cbbde936505a705e37d4962c91b28a.zip
cannot jump to a setlist count
-rw-r--r--ldebug.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ldebug.c b/ldebug.c
index 36c5c391..1db6d4d0 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 2.8 2004/09/01 13:47:31 roberto Exp $ 2** $Id: ldebug.c,v 2.9 2004/10/04 19:04:34 roberto Exp roberto $
3** Debug Interface 3** Debug Interface
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -315,6 +315,11 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) {
315 if (getBMode(op) == OpArgR) { 315 if (getBMode(op) == OpArgR) {
316 int dest = pc+1+b; 316 int dest = pc+1+b;
317 check(0 <= dest && dest < pt->sizecode); 317 check(0 <= dest && dest < pt->sizecode);
318 if (dest > 0) {
319 /* cannot jump to a setlist count */
320 const Instruction d = pt->code[dest-1];
321 check(!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0));
322 }
318 } 323 }
319 break; 324 break;
320 } 325 }
@@ -356,7 +361,8 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) {
356 break; 361 break;
357 } 362 }
358 case OP_TFORLOOP: { 363 case OP_TFORLOOP: {
359 checkreg(pt, a+5); /* space for control variables */ 364 check(c >= 1); /* at least one result (control variable) */
365 checkreg(pt, a+3+c); /* space for results */
360 if (reg >= a+3) last = pc; /* affect all regs above its call base */ 366 if (reg >= a+3) last = pc; /* affect all regs above its call base */
361 break; 367 break;
362 } 368 }