diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-09-06 14:14:11 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-09-06 14:14:11 -0300 |
| commit | 4518e5df24600cacdb3bab75d640348d28e8b769 (patch) | |
| tree | c9e8c678e718b5ccec7e7ca120bd68c5634bdfda /ldebug.c | |
| parent | 72a094bda7d71050a91a88474d67d39aa2bc1c46 (diff) | |
| download | lua-4518e5df24600cacdb3bab75d640348d28e8b769.tar.gz lua-4518e5df24600cacdb3bab75d640348d28e8b769.tar.bz2 lua-4518e5df24600cacdb3bab75d640348d28e8b769.zip | |
Added macro 'testMMMode'
Macro 'testMMMode' checks whether opcode is an MM opcode.
Diffstat (limited to 'ldebug.c')
| -rw-r--r-- | ldebug.c | 8 |
1 files changed, 3 insertions, 5 deletions
| @@ -465,16 +465,14 @@ static int filterpc (int pc, int jmptarget) { | |||
| 465 | 465 | ||
| 466 | 466 | ||
| 467 | /* | 467 | /* |
| 468 | ** try to find last instruction before 'lastpc' that modified register 'reg' | 468 | ** Try to find last instruction before 'lastpc' that modified register 'reg'. |
| 469 | */ | 469 | */ |
| 470 | static int findsetreg (const Proto *p, int lastpc, int reg) { | 470 | 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 || | 474 | if (testMMMode(GET_OPCODE(p->code[lastpc]))) |
| 475 | GET_OPCODE(p->code[lastpc]) == OP_MMBINI || | 475 | lastpc--; /* previous instruction was not actually executed */ |
| 476 | GET_OPCODE(p->code[lastpc]) == OP_MMBINK) | ||
| 477 | lastpc--; | ||
| 478 | for (pc = 0; pc < lastpc; pc++) { | 476 | for (pc = 0; pc < lastpc; pc++) { |
| 479 | Instruction i = p->code[pc]; | 477 | Instruction i = p->code[pc]; |
| 480 | OpCode op = GET_OPCODE(i); | 478 | OpCode op = GET_OPCODE(i); |
