Added macro 'testMMMode'

Macro 'testMMMode' checks whether opcode is an MM opcode.
This commit is contained in:
Roberto Ierusalimschy
2019-09-06 14:14:11 -03:00
parent 72a094bda7
commit 4518e5df24
3 changed files with 95 additions and 94 deletions

View File

@@ -465,16 +465,14 @@ static int filterpc (int pc, int jmptarget) {
/*
** try to find last instruction before 'lastpc' that modified register 'reg'
** Try to find last instruction before 'lastpc' that modified register 'reg'.
*/
static int findsetreg (const Proto *p, int lastpc, int reg) {
int pc;
int setreg = -1; /* keep last instruction that changed 'reg' */
int jmptarget = 0; /* any code before this address is conditional */
if (GET_OPCODE(p->code[lastpc]) == OP_MMBIN ||
GET_OPCODE(p->code[lastpc]) == OP_MMBINI ||
GET_OPCODE(p->code[lastpc]) == OP_MMBINK)
lastpc--;
if (testMMMode(GET_OPCODE(p->code[lastpc])))
lastpc--; /* previous instruction was not actually executed */
for (pc = 0; pc < lastpc; pc++) {
Instruction i = p->code[pc];
OpCode op = GET_OPCODE(i);