diff --git a/src/base/SMPInstr.cpp b/src/base/SMPInstr.cpp index 33d0030f239e5666638934b751f5ea0900e30bd4..7b57dd2497e5e7c5400362941866cd695eafb900 100644 --- a/src/base/SMPInstr.cpp +++ b/src/base/SMPInstr.cpp @@ -4607,6 +4607,7 @@ bool SMPInstr::MDComputeNormalizedDataFlowOp(bool UseFP, STARS_sval_t FPDelta, S // Now, we simply convert the memory operand from EBP to ESP and replace the SignedOffset with the // NormalizedDelta just computed. DefOp->SetReg(MD_STACK_POINTER_REG); + DefOp->SetByteWidth(OldOp->GetByteWidth()); // undo possible width change in SetReg() this->SetFPNormalizedToSP(); // Add the stack pointer to the USE set for the instruction. this->MDAddRegUse(MD_STACK_POINTER_REG, false); @@ -4869,6 +4870,7 @@ void SMPInstr::MDGetUnnormalizedOp(STARSOpndTypePtr &NormOp) { bool UseFP = this->GetBlock()->GetFunc()->UsesFramePointer(); if (this->AreDefsNormalized() && (0 != this->GetStackPtrOffset()) && MDIsStackAccessOpnd(NormOp, UseFP)) { if (this->HasFPNormalizedToSP()) { + size_t NormOpByteWidth = NormOp->GetByteWidth(); // Need to convert NormOp back to frame-pointer-relative address. if (NormOp->HasSIBByte()) { // Convert base register from stack pointer back to frame pointer. @@ -4877,6 +4879,7 @@ void SMPInstr::MDGetUnnormalizedOp(STARSOpndTypePtr &NormOp) { } else { NormOp->SetReg(MD_FRAME_POINTER_REG); + NormOp->SetByteWidth(NormOpByteWidth); // undo possible width change in SetReg() } SignedOffset = (STARS_sval_t) NormOp->GetAddr(); SignedOffset -= this->GetBlock()->GetFunc()->GetFramePtrStackDelta(); @@ -14059,9 +14062,11 @@ bool SMPInstr::BuildMultiplyDivideRTL(SMPoperator BinaryOp) { SMPRegTransfer *EDXRightRT = new SMPRegTransfer; EDXRightRT->SetParentInst(this); STARSOpndTypePtr EDXOp = TempRT->GetLeftOperand()->clone(); + size_t SourceByteWidth = EDXOp->GetByteWidth(); EDXRT->SetOperator(SMP_ASSIGN); assert(EDXOp->MatchesReg(STARS_x86_R_ax)); EDXOp->SetReg(STARS_x86_R_dx); + EDXOp->SetByteWidth(SourceByteWidth); // undo possible width change in SetReg() EDXRT->SetLeftOperand(EDXOp); STARSOpndTypePtr SourceOp = RightRT->GetLeftOperand(); if ((STARS_NN_div == this->GetIDAOpcode()) || (STARS_NN_idiv == this->GetIDAOpcode())) { diff --git a/tests/commit/trimmed-sorted-save-busybox.psexe.annot.REMOVED.git-id b/tests/commit/trimmed-sorted-save-busybox.psexe.annot.REMOVED.git-id index 1f3b5cd7954b3d8d015602fe86f08044e4baddde..888a04566d717b98a8a380070684fa69593209b4 100644 --- a/tests/commit/trimmed-sorted-save-busybox.psexe.annot.REMOVED.git-id +++ b/tests/commit/trimmed-sorted-save-busybox.psexe.annot.REMOVED.git-id @@ -1 +1 @@ -5ed023069117f30d8e40a0cd1e96c1918b2059cc \ No newline at end of file +cc0231bd87f595a3cbb8158cd581363bb6e25cff \ No newline at end of file