Merge remote-tracking branch 'origin/GP-3688_RuleSubNormalDouble' into

patch (Closes #5473)
This commit is contained in:
Ryan Kurtz 2023-08-07 15:33:05 -04:00
commit 26f5833f3c

View file

@ -7227,11 +7227,13 @@ int4 RuleSubNormal::applyOp(PcodeOp *op,Funcdata &data)
if (!shiftop->getIn(1)->isConstant()) return 0; if (!shiftop->getIn(1)->isConstant()) return 0;
Varnode *a = shiftop->getIn(0); Varnode *a = shiftop->getIn(0);
if (a->isFree()) return 0; if (a->isFree()) return 0;
Varnode *outvn = op->getOut();
if (outvn->isPrecisHi() || outvn->isPrecisLo()) return 0;
int4 n = shiftop->getIn(1)->getOffset(); int4 n = shiftop->getIn(1)->getOffset();
int4 c = op->getIn(1)->getOffset(); int4 c = op->getIn(1)->getOffset();
int4 k = (n/8); int4 k = (n/8);
int4 insize = a->getSize(); int4 insize = a->getSize();
int4 outsize = op->getOut()->getSize(); int4 outsize = outvn->getSize();
// Total shift + outsize must be greater equal to size of input // Total shift + outsize must be greater equal to size of input
if ((n+8*c+8*outsize < 8*insize)&&(n != k*8)) return 0; if ((n+8*c+8*outsize < 8*insize)&&(n != k*8)) return 0;