fine tuning for dominant COPY model

This commit is contained in:
caheckman 2019-05-02 13:54:36 -04:00
parent faa69124ab
commit 62fe9ad75e
8 changed files with 198 additions and 127 deletions

View file

@ -348,23 +348,28 @@ int4 HighVariable::instanceIndex(const Varnode *vn) const
return -1;
}
// Varnode *HighVariable::findGlobalRep(void) const
#ifdef MERGEMULTI_DEBUG
/// \brief Check that there are no internal Cover intersections within \b this
///
/// Look for any pair of Varnodes whose covers intersect, but they are not
/// COPY shadows. Throw an exception in this case.
void HighVariable::verifyCover(void) const
// {
// vector<Varnode *>::const_iterator iter;
// Varnode *vn = (Varnode *)0;
// Varnode *vn2;
{
Cover accumCover;
// for(iter=inst.begin();iter!=inst.end();++iter) {
// vn2 = *iter;
// if (!vn2->getSpace()->globalDiscovery())
// continue;
// if (vn==(Varnode *)0)
// vn = vn2;
// else {
// if (vn->getAddr()!=vn2->getAddr()) // Not a consistent address
// return (Varnode *)0;
// }
// }
// return vn;
// }
for(int4 i=0;i<inst.size();++i) {
Varnode *vn = inst[i];
if (accumCover.intersect(*vn->getCover()) == 2) {
for(int4 j=0;j<i;++j) {
Varnode *otherVn = inst[j];
if (otherVn->getCover()->intersect(*vn->getCover())==2) {
if (!otherVn->copyShadow(vn))
throw LowlevelError("HighVariable has internal intersection");
}
}
}
accumCover.merge(*vn->getCover());
}
}
#endif