diff options
Diffstat (limited to 'ldebug.c')
| -rw-r--r-- | ldebug.c | 21 |
1 files changed, 7 insertions, 14 deletions
| @@ -471,6 +471,10 @@ static int findsetreg (const Proto *p, int lastpc, int reg) { | |||
| 471 | int pc; | 471 | int pc; |
| 472 | int setreg = -1; /* keep last instruction that changed 'reg' */ | 472 | int setreg = -1; /* keep last instruction that changed 'reg' */ |
| 473 | int jmptarget = 0; /* any code before this address is conditional */ | 473 | int jmptarget = 0; /* any code before this address is conditional */ |
| 474 | if (GET_OPCODE(p->code[lastpc]) == OP_MMBIN || | ||
| 475 | GET_OPCODE(p->code[lastpc]) == OP_MMBINI || | ||
| 476 | GET_OPCODE(p->code[lastpc]) == OP_MMBINK) | ||
| 477 | lastpc--; | ||
| 474 | for (pc = 0; pc < lastpc; pc++) { | 478 | for (pc = 0; pc < lastpc; pc++) { |
| 475 | Instruction i = p->code[pc]; | 479 | Instruction i = p->code[pc]; |
| 476 | OpCode op = GET_OPCODE(i); | 480 | OpCode op = GET_OPCODE(i); |
| @@ -620,22 +624,11 @@ static const char *funcnamefromcode (lua_State *L, CallInfo *ci, | |||
| 620 | case OP_SETTABUP: case OP_SETTABLE: case OP_SETI: case OP_SETFIELD: | 624 | case OP_SETTABUP: case OP_SETTABLE: case OP_SETI: case OP_SETFIELD: |
| 621 | tm = TM_NEWINDEX; | 625 | tm = TM_NEWINDEX; |
| 622 | break; | 626 | break; |
| 623 | case OP_ADDI: case OP_SUBI: case OP_MULI: case OP_MODI: | 627 | case OP_MMBIN: case OP_MMBINI: case OP_MMBINK: { |
| 624 | case OP_POWI: case OP_DIVI: case OP_IDIVI: { | 628 | tm = cast(TMS, GETARG_C(i)); |
| 625 | int offset = GET_OPCODE(i) - OP_ADDI; /* ORDER OP */ | ||
| 626 | tm = cast(TMS, offset + TM_ADD); /* ORDER TM */ | ||
| 627 | break; | ||
| 628 | } | ||
| 629 | case OP_ADDK: case OP_SUBK: case OP_MULK: case OP_MODK: | ||
| 630 | case OP_POWK: case OP_DIVK: case OP_IDIVK: | ||
| 631 | case OP_BANDK: case OP_BORK: case OP_BXORK: { | ||
| 632 | int offset = GET_OPCODE(i) - OP_ADDK; /* ORDER OP */ | ||
| 633 | tm = cast(TMS, offset + TM_ADD); /* ORDER TM */ | ||
| 634 | break; | 629 | break; |
| 635 | } | 630 | } |
| 636 | case OP_ADD: case OP_SUB: case OP_MUL: case OP_MOD: | 631 | case OP_SHL: case OP_SHR: { |
| 637 | case OP_POW: case OP_DIV: case OP_IDIV: case OP_BAND: | ||
| 638 | case OP_BOR: case OP_BXOR: case OP_SHL: case OP_SHR: { | ||
| 639 | int offset = GET_OPCODE(i) - OP_ADD; /* ORDER OP */ | 632 | int offset = GET_OPCODE(i) - OP_ADD; /* ORDER OP */ |
| 640 | tm = cast(TMS, offset + TM_ADD); /* ORDER TM */ | 633 | tm = cast(TMS, offset + TM_ADD); /* ORDER TM */ |
| 641 | break; | 634 | break; |
