mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
Fix allowing decompiler to simplify some forms of division/remainder
constructions
This commit is contained in:
parent
8c3a79deb1
commit
4e3d6552bd
1 changed files with 7 additions and 1 deletions
|
@ -3192,7 +3192,13 @@ int4 RuleShiftPiece::applyOp(PcodeOp *op,Funcdata &data)
|
|||
(zexthiop->code()!= CPUI_INT_SEXT))
|
||||
return 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 concatsize = sa + 8*vn1->getSize();
|
||||
if (op->getOut()->getSize() * 8 < concatsize) return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue