MCPcopy Create free account
hub / github.com/SVF-tools/SVF / onTheFlyThreadCallGraphSolve

Method onTheFlyThreadCallGraphSolve

svf/lib/MemoryModel/PointerAnalysisImpl.cpp:523–553  ·  view source on GitHub ↗

! * On the fly call graph construction respecting forksite * callsites is candidate indirect callsites need to be analyzed based on points-to results * newEdges is the new indirect call edges discovered */

Source from the content-addressed store, hash-verified

521 * newEdges is the new indirect call edges discovered
522 */
523void BVDataPTAImpl::onTheFlyThreadCallGraphSolve(const CallSiteToFunPtrMap& callsites,
524 CallEdgeMap& newForkEdges)
525{
526 // add indirect fork edges
527 if(ThreadCallGraph *tdCallGraph = SVFUtil::dyn_cast<ThreadCallGraph>(callgraph))
528 {
529 for(CallSiteSet::const_iterator it = tdCallGraph->forksitesBegin(),
530 eit = tdCallGraph->forksitesEnd(); it != eit; ++it)
531 {
532 const ValVar* pVar = tdCallGraph->getThreadAPI()->getForkedFun(*it);
533 if(SVFUtil::dyn_cast<FunValVar>(pVar) == nullptr)
534 {
535 SVFIR *pag = this->getPAG();
536 const NodeBS targets = this->getPts(pVar->getId()).toNodeBS();
537 for(NodeBS::iterator ii = targets.begin(), ie = targets.end(); ii != ie; ++ii)
538 {
539 if(const ObjVar *objPN = pag->getObjVar(*ii))
540 {
541 const BaseObjVar* obj = pag->getBaseObject(objPN->getId());
542 if(obj->isFunction())
543 {
544 const FunObjVar *svfForkedFun = SVFUtil::cast<FunObjVar>(obj)->getFunction();
545 if(tdCallGraph->addIndirectForkEdge(*it, svfForkedFun))
546 newForkEdges[*it].insert(svfForkedFun);
547 }
548 }
549 }
550 }
551 }
552 }
553}
554
555/*!
556 * Normalize points-to information for field-sensitive analysis

Callers

nothing calls this directly

Calls 15

forksitesBeginMethod · 0.80
forksitesEndMethod · 0.80
getForkedFunMethod · 0.80
toNodeBSMethod · 0.80
getObjVarMethod · 0.80
getBaseObjectMethod · 0.80
addIndirectForkEdgeMethod · 0.80
insertMethod · 0.80
getThreadAPIMethod · 0.45
getPAGMethod · 0.45
getIdMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected