mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-02-18 00:20:10 +00:00
Fix allowing decompiler to simplify some forms of division/remainder
constructions
This commit is contained in:
parent
8c3a79deb1
commit
4e3d6552bd
@ -3192,7 +3192,13 @@ int4 RuleShiftPiece::applyOp(PcodeOp *op,Funcdata &data)
|
|||||||
(zexthiop->code()!= CPUI_INT_SEXT))
|
(zexthiop->code()!= CPUI_INT_SEXT))
|
||||||
return 0;
|
return 0;
|
||||||
vn1 = zexthiop->getIn(0);
|
vn1 = zexthiop->getIn(0);
|
||||||
if (vn1->isFree()) return 0;
|
if (vn1->isConstant()) {
|
||||||
|
if (vn1->getSize() < sizeof(uintb))
|
||||||
|
return 0; // Normally we let ZEXT of a constant collapse naturally
|
||||||
|
// But if the ZEXTed constant is too big, this won't happen
|
||||||
|
}
|
||||||
|
else if (vn1->isFree())
|
||||||
|
return 0;
|
||||||
int4 sa = shiftop->getIn(1)->getOffset();
|
int4 sa = shiftop->getIn(1)->getOffset();
|
||||||
int4 concatsize = sa + 8*vn1->getSize();
|
int4 concatsize = sa + 8*vn1->getSize();
|
||||||
if (op->getOut()->getSize() * 8 < concatsize) return 0;
|
if (op->getOut()->getSize() * 8 < concatsize) return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user