Skip to content

Commit

Permalink
Fix issue #1548
Browse files Browse the repository at this point in the history
  • Loading branch information
yuleisui committed Sep 18, 2024
1 parent 0059690 commit fc185be
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions svf/lib/Graphs/ConsG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,24 @@ void ConstraintGraph::buildCG()
*/
void ConstraintGraph::clearSolitaries()
{
/// We don't remove return SVFVar from an indirect callsite
NodeSet retFromIndCalls;
for(auto cs_pair : pag->getIndirectCallsites())
{
const RetICFGNode* retBlockNode = cs_pair.first->getRetICFGNode();
if(pag->callsiteHasRet(retBlockNode))
retFromIndCalls.insert(pag->getCallSiteRet(retBlockNode)->getId());
}

Set<ConstraintNode*> nodesToRemove;
for (auto it = this->begin(); it != this->end(); ++it)
{
if (it->second->hasIncomingEdge() || it->second->hasOutgoingEdge())
continue;
if (pag->getGNode(it->first)->isPointer())
continue;
if (retFromIndCalls.find(it->first)!=retFromIndCalls.end())
continue;
nodesToRemove.insert(it->second);
}

Expand Down

0 comments on commit fc185be

Please sign in to comment.