diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-01-16 20:03:57 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-01-16 20:03:57 -0200 |
commit | 7ab7703b53be3024a06334653b29dac338e55a01 (patch) | |
tree | becc738e21f7d328cd21b73bb1b4da445d96aee6 /ldebug.c | |
parent | 566310fa04621a6fb848efec5cd00b7c9c6575c8 (diff) | |
download | lua-7ab7703b53be3024a06334653b29dac338e55a01.tar.gz lua-7ab7703b53be3024a06334653b29dac338e55a01.tar.bz2 lua-7ab7703b53be3024a06334653b29dac338e55a01.zip |
cleaner semantics for test instructions (skips)
Diffstat (limited to 'ldebug.c')
-rw-r--r-- | ldebug.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 1.96 2001/12/18 20:52:30 roberto Exp $ | 2 | ** $Id: ldebug.c,v 1.97 2002/01/09 22:02:47 roberto Exp $ |
3 | ** Debug Interface | 3 | ** Debug Interface |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -350,7 +350,7 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) { | |||
350 | if (a == reg) last = pc; /* change register `a' */ | 350 | if (a == reg) last = pc; /* change register `a' */ |
351 | } | 351 | } |
352 | if (testOpMode(op, OpModeT)) | 352 | if (testOpMode(op, OpModeT)) |
353 | check(GET_OPCODE(pt->code[pc+1]) == OP_CJMP); | 353 | check(pc+2 < pt->sizecode); /* check skip */ |
354 | switch (op) { | 354 | switch (op) { |
355 | case OP_LOADBOOL: { | 355 | case OP_LOADBOOL: { |
356 | check(c == 0 || pc+2 < pt->sizecode); /* check its jump */ | 356 | check(c == 0 || pc+2 < pt->sizecode); /* check its jump */ |
@@ -381,8 +381,7 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) { | |||
381 | check(c < MAXSTACK && b < c); | 381 | check(c < MAXSTACK && b < c); |
382 | break; | 382 | break; |
383 | } | 383 | } |
384 | case OP_JMP: | 384 | case OP_JMP: { |
385 | case OP_CJMP: { | ||
386 | int dest = pc+1+b; | 385 | int dest = pc+1+b; |
387 | check(0 <= dest && dest < pt->sizecode); | 386 | check(0 <= dest && dest < pt->sizecode); |
388 | /* not full check and jump is forward and do not skip `lastpc'? */ | 387 | /* not full check and jump is forward and do not skip `lastpc'? */ |