diff --git a/SMPInstr.cpp b/SMPInstr.cpp index 2d030d52bbd86aa46a5fffa81366dd36367097b5..07bc70cc9e279fde59eba4dbaec74fa181de82e3 100644 --- a/SMPInstr.cpp +++ b/SMPInstr.cpp @@ -1249,6 +1249,8 @@ void SMPInstr::MDFixupDefUseLists(void) { #endif this->MDAddRegDef(R_bx, false); this->MDAddRegUse(R_bx, false); + this->MDAddRegDef(R_si, false); + this->MDAddRegUse(R_si, false); #if 1 } #endif @@ -2641,13 +2643,18 @@ void SMPInstr::AnnotateStackConstants(bool UseFP, FILE *AnnotFile) { if (NN_lea == this->SMPcmd.itype) { ESPoffset = this->MDGetImmedUse(); } - if (UseFP && this->GetFirstUse()->GetOp().is_reg(R_bp)) { - qfprintf(AnnotFile, "%10x %6d PTRIMMEDEBP STACK %d displ %s\n", - SMPcmd.ea, SMPcmd.size, ESPoffset, disasm); - } + // NOTE: Looks like this next line should be "else" because an lea instruction + // looks like it has a memory operand, hence it has already been handled above. + // We are getting duplicate annotations for lea instructions. else { - qfprintf(AnnotFile, "%10x %6d PTRIMMEDESP STACK %d displ %s\n", - SMPcmd.ea, SMPcmd.size, ESPoffset, disasm); + if (UseFP && this->GetFirstUse()->GetOp().is_reg(R_bp)) { + qfprintf(AnnotFile, "%10x %6d PTRIMMEDEBP STACK %d displ %s\n", + SMPcmd.ea, SMPcmd.size, ESPoffset, disasm); + } + else { + qfprintf(AnnotFile, "%10x %6d PTRIMMEDESP STACK %d displ %s\n", + SMPcmd.ea, SMPcmd.size, ESPoffset, disasm); + } } }