Don't let splitflow undo double-precision merges

This commit is contained in:
caheckman 2021-08-31 15:37:58 -04:00
parent 169d9859f7
commit 1271bf044a
3 changed files with 6 additions and 0 deletions

View file

@ -723,6 +723,8 @@ void SplitVarnode::wholeList(Varnode *w,vector<SplitVarnode> &splitvec)
}
}
if (res==0) return;
if (res == 3 && (basic.lo->getSize() + basic.hi->getSize() != basic.wholesize))
return;
splitvec.push_back(basic);
findCopies(basic,splitvec);

View file

@ -7610,6 +7610,8 @@ int4 RuleSplitFlow::applyOp(PcodeOp *op,Funcdata &data)
Varnode *vn = op->getIn(0);
if (!vn->isWritten())
return 0;
if (vn->isPrecisLo() || vn->isPrecisHi())
return 0;
if (op->getOut()->getSize() + loSize != vn->getSize())
return 0; // Make sure SUBPIECE is taking most significant part
PcodeOp *concatOp = (PcodeOp *)0;

View file

@ -1554,6 +1554,8 @@ bool SplitFlow::traceForward(TransformVar *rvn)
break;
case CPUI_SUBPIECE:
{
if (outvn->isPrecisLo() || outvn->isPrecisHi())
return false; // Do not split if we know value comes from double precision pieces
uintb val = op->getIn(1)->getOffset();
if ((val==0)&&(outvn->getSize() == laneDescription.getSize(0))) {
TransformOp *rop = newPreexistingOp(1,CPUI_COPY,op); // Grabs the low piece