Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SMPStaticAnalyzer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
SMPStaticAnalyzer
Commits
c8befeea
Commit
c8befeea
authored
9 years ago
by
clc5q
Browse files
Options
Downloads
Patches
Plain Diff
Bug fix: Retain original byte width for normalized stack operands.
Former-commit-id: 49e1dbbf61159acd2919f55c0198b38cb29493e9
parent
a7a94176
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/base/SMPInstr.cpp
+5
-0
5 additions, 0 deletions
src/base/SMPInstr.cpp
tests/commit/trimmed-sorted-save-busybox.psexe.annot.REMOVED.git-id
+1
-1
1 addition, 1 deletion
...it/trimmed-sorted-save-busybox.psexe.annot.REMOVED.git-id
with
6 additions
and
1 deletion
src/base/SMPInstr.cpp
+
5
−
0
View file @
c8befeea
...
...
@@ -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())) {
...
...
This diff is collapsed.
Click to expand it.
tests/commit/trimmed-sorted-save-busybox.psexe.annot.REMOVED.git-id
+
1
−
1
View file @
c8befeea
5ed023069117f30d8e40a0cd1e96c1918b2059cc
\ No newline at end of file
cc0231bd87f595a3cbb8158cd581363bb6e25cff
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment