! * 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 */
| 521 | * newEdges is the new indirect call edges discovered |
| 522 | */ |
| 523 | void 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 |
nothing calls this directly
no test coverage detected