From 4518e5df24600cacdb3bab75d640348d28e8b769 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 6 Sep 2019 14:14:11 -0300 Subject: Added macro 'testMMMode' Macro 'testMMMode' checks whether opcode is an MM opcode. --- ldebug.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index aef52e15..6e16b0fb 100644 --- a/ldebug.c +++ b/ldebug.c @@ -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); -- cgit v1.2.3-55-g6feb