Adjust likelytrash action to account for STORE based INDIRECTs

This commit is contained in:
caheckman 2019-06-28 18:11:01 -04:00
parent feb2e6887b
commit 29f207400d

View file

@ -1716,7 +1716,13 @@ uint4 ActionLikelyTrash::countMarks(PcodeOp *op)
res += 1; res += 1;
break; break;
} }
if (!vn->isWritten()||(vn->getDef()->code()!=CPUI_INDIRECT)) // Chain up through INDIRECTs if (!vn->isWritten()) break;
PcodeOp *defOp = vn->getDef();
if (defOp == op) { // We have looped all the way around
res += 1;
break;
}
else if (defOp->code() != CPUI_INDIRECT) // Chain up through INDIRECTs
break; break;
vn = vn->getDef()->getIn(0); vn = vn->getDef()->getIn(0);
} }
@ -1763,6 +1769,12 @@ bool ActionLikelyTrash::traceTrash(Varnode *vn,vector<PcodeOp *> &indlist)
case CPUI_INDIRECT: case CPUI_INDIRECT:
if (outvn->isPersist()) if (outvn->isPersist())
istrash = false; istrash = false;
else if (op->isIndirectStore()) {
if (!outvn->isMark()) {
outvn->setMark();
markedlist.push_back(outvn);
}
}
else else
indlist.push_back(op); indlist.push_back(op);
break; break;