33 using namespace SVFUtil;
45 const SVFGNode* source = getSource();
47 worklist.
push(source);
49 setVFCond(source,getTrueCond());
51 while(!worklist.
empty())
56 Condition invalidCond = computeInvalidCondFromRemovedSUVFEdge(node);
62 if(inBackwardSlice(succ))
72 vfCond = ComputeInterCallVFGGuard(nodeBB,succBB, getCallSite(edge)->getParent());
76 vfCond = ComputeInterRetVFGGuard(nodeBB,succBB, getRetSite(edge)->getParent());
79 vfCond = ComputeIntraVFGGuard(nodeBB,succBB);
80 vfCond = condAnd(vfCond, condNeg(invalidCond));
81 Condition succPathCond = condAnd(cond, vfCond);
82 if(setVFCond(succ, condOr(getVFCond(succ), succPathCond) ))
87 ") --> " <<
"succ (" << succ->
getId() <<
") condition: " << getVFCond(succ) <<
"\n");
91 return isSatisfiableForAll();
115 if(inBackwardSlice(succ))
117 validOutBBs.insert(getSVFGNodeBB(succ));
121 auto suVFEdgesIt = getRemovedSUVFEdges().find(cur);
122 if (suVFEdgesIt != getRemovedSUVFEdges().end())
124 for (
const auto &succ: suVFEdgesIt->second)
126 if (!validOutBBs.count(getSVFGNodeBB(succ)))
132 invalidCond = condOr(invalidCond, ComputeIntraVFGGuard(nodeBB, succBB));
146 for(
SVFGNodeSetIter it = sinksBegin(), eit = sinksEnd(); it!=eit; ++it)
148 guard = condOr(guard,getVFCond(*it));
152 return pathAllocator->isAllPathReachable(guard);
161 for(
SVFGNodeSetIter it = sinksBegin(), eit = sinksEnd(); it!=eit; ++it)
167 Condition guard = condAnd(getVFCond(*sit),getVFCond(*it));
168 if(!isEquivalentBranchCond(guard, getFalseCond()))
182 if(
const CallDirSVFGEdge* callEdge = SVFUtil::dyn_cast<CallDirSVFGEdge>(edge))
183 return getSVFG()->getCallSite(callEdge->getCallSiteId());
185 return getSVFG()->getCallSite(SVFUtil::cast<CallIndSVFGEdge>(edge)->getCallSiteId());
189 assert(edge->
isRetVFGEdge() &&
"not a return svfg edge?");
190 if(
const RetDirSVFGEdge* callEdge = SVFUtil::dyn_cast<RetDirSVFGEdge>(edge))
191 return getSVFG()->getCallSite(callEdge->getCallSiteId());
193 return getSVFG()->getCallSite(SVFUtil::cast<RetIndSVFGEdge>(edge)->getCallSiteId());
198 NodeBS elems = pathAllocator->exactCondElem(finalCond);
201 const ICFGNode* tinst = pathAllocator->getCondInst(*it);
202 if(pathAllocator->isNegCond(*it))
223 std::stringstream rawstr(str);
225 NodeBS elems = pathAllocator->exactCondElem(finalCond);
229 const ICFGNode* tinst = pathAllocator->getCondInst(*it);
230 if(pathAllocator->isNegCond(*it))
240 rawstr <<
"\t\t --> (" << *iter <<
") \n";
#define DBOUT(TYPE, X)
LLVM debug macros, define type of your DBUG model of each pass.
bool push(const Data &data)
std::vector< SVFBugEvent > EventStack
NodeType * getDstNode() const
iterator OutEdgeBegin()
iterators
const CallICFGNode * getRetSite(const SVFGEdge *edge) const
void evalFinalCond2Event(GenericBug::EventStack &eventStack) const
Add final condition to eventStack.
bool isSatisfiableForPairs()
bool isSatisfiableForAll()
void destroy()
Release memory.
const CallICFGNode * getCallSite(const SVFGEdge *edge) const
Get callsite ID and get returnsiteID from SVFGEdge.
bool AllPathReachableSolve()
Guarded reachability solve.
Condition computeInvalidCondFromRemovedSUVFEdge(const SVFGNode *cur)
Compute invalid branch condition stemming from removed strong update value-flow edges.
SVFGNodeSet::const_iterator SVFGNodeSetIter
std::string evalFinalCond() const
Evaluate final condition.
NodeID getId() const
Get ID.
virtual const std::string getSourceLoc() const
bool isRetVFGEdge() const
bool isCallVFGEdge() const
VFGEdge::VFGEdgeSetTy::const_iterator const_iterator
std::ostream & outs()
Overwrite llvm::outs()
std::unordered_set< Key, Hash, KeyEqual, Allocator > Set