diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-08-07 16:04:06 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-08-07 16:04:06 -0300 |
| commit | ca7e5b5cb62246653647753f5a6e7fa85e8f030d (patch) | |
| tree | cbf652660c45c0bff4a5ca7d20c6cb92ccc34067 /ldebug.c | |
| parent | 5019b2dd205751c6f29c4ced2b6f1e22c096fb83 (diff) | |
| download | lua-ca7e5b5cb62246653647753f5a6e7fa85e8f030d.tar.gz lua-ca7e5b5cb62246653647753f5a6e7fa85e8f030d.tar.bz2 lua-ca7e5b5cb62246653647753f5a6e7fa85e8f030d.zip | |
wrong message error in some cases involving closures
Diffstat (limited to 'ldebug.c')
| -rw-r--r-- | ldebug.c | 10 |
1 files changed, 6 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldebug.c,v 2.29 2005/12/22 16:19:56 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.30 2006/07/11 15:53:29 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 | */ |
| @@ -435,14 +435,16 @@ static Instruction symbexec (const Proto *pt, int lastpc, int reg) { | |||
| 435 | break; | 435 | break; |
| 436 | } | 436 | } |
| 437 | case OP_CLOSURE: { | 437 | case OP_CLOSURE: { |
| 438 | int nup; | 438 | int nup, j; |
| 439 | check(b < pt->sizep); | 439 | check(b < pt->sizep); |
| 440 | nup = pt->p[b]->nups; | 440 | nup = pt->p[b]->nups; |
| 441 | check(pc + nup < pt->sizecode); | 441 | check(pc + nup < pt->sizecode); |
| 442 | for (; nup>0; nup--) { | 442 | for (j = 1; j <= nup; j++) { |
| 443 | OpCode op1 = GET_OPCODE(pt->code[pc+nup]); | 443 | OpCode op1 = GET_OPCODE(pt->code[pc + j]); |
| 444 | check(op1 == OP_GETUPVAL || op1 == OP_MOVE); | 444 | check(op1 == OP_GETUPVAL || op1 == OP_MOVE); |
| 445 | } | 445 | } |
| 446 | if (reg != NO_REG) /* tracing? */ | ||
| 447 | pc += nup; /* do not 'execute' these pseudo-instructions */ | ||
| 446 | break; | 448 | break; |
| 447 | } | 449 | } |
| 448 | case OP_VARARG: { | 450 | case OP_VARARG: { |
