Skip to content

Commit fc95d1c

Browse files
committed
Merge remote-tracking branch 'origin/GP-1270_DoublePrecisionInfLoop'
into patch (Fixes NationalSecurityAgency#3105)
2 parents 999454d + 1271bf0 commit fc95d1c

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Ghidra/Features/Decompiler/src/decompile/cpp/double.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,8 @@ void SplitVarnode::wholeList(Varnode *w,vector<SplitVarnode> &splitvec)
723723
}
724724
}
725725
if (res==0) return;
726+
if (res == 3 && (basic.lo->getSize() + basic.hi->getSize() != basic.wholesize))
727+
return;
726728

727729
splitvec.push_back(basic);
728730
findCopies(basic,splitvec);

Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7610,6 +7610,8 @@ int4 RuleSplitFlow::applyOp(PcodeOp *op,Funcdata &data)
76107610
Varnode *vn = op->getIn(0);
76117611
if (!vn->isWritten())
76127612
return 0;
7613+
if (vn->isPrecisLo() || vn->isPrecisHi())
7614+
return 0;
76137615
if (op->getOut()->getSize() + loSize != vn->getSize())
76147616
return 0; // Make sure SUBPIECE is taking most significant part
76157617
PcodeOp *concatOp = (PcodeOp *)0;

Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,8 @@ bool SplitFlow::traceForward(TransformVar *rvn)
15541554
break;
15551555
case CPUI_SUBPIECE:
15561556
{
1557+
if (outvn->isPrecisLo() || outvn->isPrecisHi())
1558+
return false; // Do not split if we know value comes from double precision pieces
15571559
uintb val = op->getIn(1)->getOffset();
15581560
if ((val==0)&&(outvn->getSize() == laneDescription.getSize(0))) {
15591561
TransformOp *rop = newPreexistingOp(1,CPUI_COPY,op); // Grabs the low piece

0 commit comments

Comments
 (0)