-
Notifications
You must be signed in to change notification settings - Fork 476
Description
全局集合有两个points to分别是(r1,r2)(r2,r3),经过计算交集成了(r1)(r2)(r3)三个内存区域,之后在getMRsForLoad时是这样子的
实际工作机制
在 MRGenerator 基类中,getMRsForLoad 的默认实现非常简单[link to Repo SVF-tools/SVF: svf/include/MSSA/MemRegion.h:316-321]:
virtual inline void getMRsForLoad(MRSet& aliasMRs, const NodeBS& cpts, const FunObjVar*)
{
const MemRegion* mr = getMR(cpts);
aliasMRs.insert(mr);
}
查看 getMR 的实现[link to Repo SVF-tools/SVF: svf/lib/MSSA/MemRegion.cpp:92-98]:
const MemRegion* MRGenerator::getMR(const NodeBS& cpts) const
{
MemRegion mr(getRepPointsTo(cpts));
MRSet::iterator mit = memRegSet.find(&mr);
assert(mit!=memRegSet.end() && "memory region not found!!");
return *mit;
}
关键在于 getRepPointsTo(cpts)[link to Repo SVF-tools/SVF: svf/include/MSSA/MemRegion.h:186-191],它会查找 cptsToRepCPtsMap:
inline const NodeBS& getRepPointsTo(const NodeBS& cpts) const
{
PtsToRepPtsSetMap::const_iterator it = cptsToRepCPtsMap.find(cpts);
assert(it!=cptsToRepCPtsMap.end() && "can not find superset of cpts??");
return it->second;
}这个是实际的实现,好像不能够解决上面我提出的那个问题?