mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
precision checks
This commit is contained in:
parent
e90c0c7071
commit
c267e85e1e
1 changed files with 2 additions and 2 deletions
|
@ -543,6 +543,7 @@ int4 RuleShiftBitops::applyOp(PcodeOp *op,Funcdata &data)
|
||||||
if (!constvn->isConstant()) return 0; // Must be a constant shift
|
if (!constvn->isConstant()) return 0; // Must be a constant shift
|
||||||
Varnode *vn = op->getIn(0);
|
Varnode *vn = op->getIn(0);
|
||||||
if (!vn->isWritten()) return 0;
|
if (!vn->isWritten()) return 0;
|
||||||
|
if (vn->getSize() > sizeof(uintb)) return 0; // FIXME: Can't exceed uintb precision
|
||||||
int4 sa;
|
int4 sa;
|
||||||
bool leftshift;
|
bool leftshift;
|
||||||
|
|
||||||
|
@ -4972,6 +4973,7 @@ int4 RuleEmbed::applyOp(PcodeOp *op,Funcdata &data)
|
||||||
PcodeOp *subop;
|
PcodeOp *subop;
|
||||||
int4 i;
|
int4 i;
|
||||||
|
|
||||||
|
if (op->getOut()->getSize() > sizeof(uintb)) return 0; // FIXME: Can't exceed uintb precision
|
||||||
for(i=0;i<2;++i) {
|
for(i=0;i<2;++i) {
|
||||||
subout = op->getIn(i);
|
subout = op->getIn(i);
|
||||||
if (!subout->isWritten()) continue;
|
if (!subout->isWritten()) continue;
|
||||||
|
@ -5001,8 +5003,6 @@ int4 RuleEmbed::applyOp(PcodeOp *op,Funcdata &data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Be careful of precision limit when constructing mask
|
|
||||||
if (subout->getSize() + c > sizeof(uintb)) continue;
|
|
||||||
uintb mask = calc_mask(subout->getSize());
|
uintb mask = calc_mask(subout->getSize());
|
||||||
mask <<= 8*c;
|
mask <<= 8*c;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue