GP-3518 Additional double precision checks

This commit is contained in:
caheckman 2023-06-05 20:13:52 -04:00
parent 69fa35638b
commit 603cf5523f
2 changed files with 15 additions and 5 deletions

View file

@ -787,10 +787,14 @@ bool SplitVarnode::isAddrTiedContiguous(Varnode *lo,Varnode *hi,Address &res)
if (!hi->isAddrTied()) return false;
// Make sure there is no explicit symbol that would prevent the pieces from being joined
SymbolEntry *entry = lo->getSymbolEntry();
if ((entry != (SymbolEntry *)0)&&(entry->getOffset()==0)) return false;
entry = hi->getSymbolEntry();
if ((entry != (SymbolEntry *)0)&&(entry->getOffset()==0)) return false;
SymbolEntry *entryLo = lo->getSymbolEntry();
SymbolEntry *entryHi = hi->getSymbolEntry();
if (entryLo != (SymbolEntry *)0 || entryHi != (SymbolEntry *)0) {
if (entryLo == (SymbolEntry *)0 || entryHi == (SymbolEntry *)0)
return false; // One is marked with a symbol, the other is not
if (entryLo->getSymbol() != entryHi->getSymbol())
return false; // They are part of different symbols
}
AddrSpace *spc = lo->getSpace();
if (spc != hi->getSpace()) return false;
uintb looffset = lo->getOffset();
@ -3093,6 +3097,12 @@ bool IndirectForm::verify(Varnode *h,Varnode *l,PcodeOp *ind)
if (affector != PcodeOp::getOpFromConst(indlo->getIn(1)->getAddr())) continue; // hi and lo must be affected by same op
reslo = indlo->getOut();
if (reslo->getSpace()->getType() == IPTR_INTERNAL) return false; // Indirect must not be through a temporary
if (reslo->isAddrTied() || reshi->isAddrTied()) {
Address addr;
// If one piece is address tied, the other must be as well, and they must fit together as contiguous whole
if (!SplitVarnode::isAddrTiedContiguous(reslo, reshi, addr))
return false;
}
return true;
}
return false;