diff --git a/SMPInstr.cpp b/SMPInstr.cpp index 9077ae071693f0745c9408a7258168ba1125c933..8e30f04595cba7a0ab7efd6b8863335405bf5166 100644 --- a/SMPInstr.cpp +++ b/SMPInstr.cpp @@ -778,6 +778,7 @@ void SMPInstr::MDFixupDefUseLists(void) { ea_t displacement; bool UseFP = true; bool HasIndexReg = false; + bool SingleAddressReg = false; bool leaInst = (NN_lea == this->SMPcmd.itype); bool DebugFlag = (this->GetAddr() == 0x804837b); if (DebugFlag) { @@ -796,6 +797,8 @@ void SMPInstr::MDFixupDefUseLists(void) { op_t Opnd = SMPcmd.Operands[OpNum]; if ((Opnd.type == o_phrase) || (Opnd.type == o_displ) || (Opnd.type == o_mem)) { MDExtractAddressFields(Opnd, BaseReg, IndexReg, ScaleFactor, displacement); + SingleAddressReg = ((0 == displacement) + && ((R_none == BaseReg) || (R_none == IndexReg))); if (R_none != IndexReg) { op_t IndexOpnd = Opnd; // Init to current operand field values IndexOpnd.type = o_reg; // Change type and reg fields @@ -836,9 +839,10 @@ void SMPInstr::MDFixupDefUseLists(void) { // We cannot be sure that a register is truly a base register unless // there is also an index register. E.g. with reg+displacement, we // could have memaddr+indexreg or basereg+offset, depending on what - // the displacement is. + // the displacement is. The exception is if there is no offset and only + // one addressing register, e.g. mov eax,[ebx]. if (BaseOpnd.is_reg(R_sp) || (UseFP && BaseOpnd.is_reg(R_bp)) - || leaInst || (!HasIndexReg)) { + || leaInst || (!HasIndexReg && !SingleAddressReg)) { ; } else {