158 for (
auto eit =
v->InEdgeBegin();
eit !=
v->InEdgeEnd(); ++
eit)
161 SVFUtil::dyn_cast<IndirectSVFGEdge>(*
eit);
165 SVFUtil::dyn_cast<SVFGNode>(
indEdge->getSrcNode());
166 assert(src &&
"SVFG incoming edge must have a source node");
167 assert(
v &&
"SVFG incoming edge must have a destination node");
171 assert(
srcICFG &&
"SVFG source node must have an ICFG node");
173 "SVFG destination node must have an ICFG node");
185 if (SVFUtil::isa<GepObjVar>(
gn))
189 else if (
auto* base = SVFUtil::dyn_cast<BaseObjVar>(
gn))
245 if (SVFUtil::isa<StoreVFGNode>(
vfgNode) &&
246 vfgNode->getDefSVFVars().intersects(
edge->getPointsTo()))
256 assert(
edge &&
"Indirect SVFG edge must exist");
257 assert(dst &&
"Indirect SVFG edge must have a destination node");
259 const SVFGNode* src = SVFUtil::dyn_cast<SVFGNode>(
edge->getSrcNode());
260 assert(src &&
"Indirect SVFG edge must have an SVFG source node");
264 assert(
srcICFG &&
"SVFG source node must have an ICFG node");
265 assert(
dstICFG &&
"SVFG destination node must have an ICFG node");
273 else if (!fun || fun !=
dstICFG->getFun())
280 std::deque<const ICFGNode*> worklist;
285 while (!worklist.empty() && !
feasible)
287 const ICFGNode* cur = worklist.front();
288 worklist.pop_front();
301 SVFUtil::dyn_cast<CallICFGNode>(cur))
312 else if (!visited.count(
succ))
314 visited.insert(
succ);
315 worklist.push_back(
succ);
326 SVFUtil::dyn_cast<IntraCFGEdge>(
icfgEdge);
334 else if (!
succ ||
succ->getFun() != fun)
346 else if (!visited.count(
succ))
348 visited.insert(
succ);
349 worklist.push_back(
succ);
378 if (!fun || fun != dst->
getFun())
385 std::deque<const ICFGNode*> worklist;
387 worklist.push_back(src);
390 while (!worklist.empty() && !
feasible)
392 const ICFGNode* cur = worklist.front();
393 worklist.pop_front();
400 SVFUtil::dyn_cast<CallICFGNode>(cur))
407 else if (
succ == dst)
411 else if (!visited.count(
succ))
413 visited.insert(
succ);
414 worklist.push_back(
succ);
425 SVFUtil::dyn_cast<IntraCFGEdge>(
edge);
433 else if (!
succ ||
succ->getFun() != fun)
441 else if (
succ == dst)
445 else if (!visited.count(
succ))
447 visited.insert(
succ);
448 worklist.push_back(
succ);
466 if (!
edge->getCondition())
537 auto eit =
pit->second.find(
it->first);
538 if (
eit ==
pit->second.end())
544 it->second.join_with(
eit->second);
563 rit->second.meet_with(
val);
582 if (
trace.inAddrToValTable(
id))
630 for (
const auto& [
id,
val] :
next.getVarToVal())
649 for (
const auto& [
id,
val] :
next.getVarToVal())
691 if (!
var->getICFGNode())
696 else if (SVFUtil::isa<CallICFGNode>(
var->getICFGNode()) &&
697 SVFUtil::isa<RetValPN>(
var))
699 return SVFUtil::dyn_cast<CallICFGNode>(
var->getICFGNode())
706 return var->getICFGNode();
static bool hasRedefineToSameObj(const ICFGNode *node, const IndirectSVFGEdge *edge)
AndersenWaveDiff * getPointerAnalysis() const
Accessors for Andersen's results.
const Set< const ValVar * > getCycleValVars(const ICFGCycleWTO *cycle) const
AbstractState & getAbsState(const ICFGNode *node)
virtual bool narrowCycleState(const AbstractState &prev, const AbstractState &cur, const ICFGCycleWTO *cycle)
virtual bool hasAbsValue(const ValVar *var, const ICFGNode *node) const
Side-effect-free existence check.
virtual AbstractState getFullCycleHeadState(const ICFGCycleWTO *cycle)
bool isBranchEdgeFeasible(const IntraCFGEdge *edge, AbstractState &as)
virtual bool widenCycleState(const AbstractState &prev, const AbstractState &cur, const ICFGCycleWTO *cycle)
virtual bool mergeStatesFromPredecessors(const ICFGNode *node)
SVFIR * svfir
Data and helpers reachable from SparseAbstractInterpretation.
virtual const AbstractValue & getAbsValue(const ValVar *var, const ICFGNode *node)
bool hasAbsState(const ICFGNode *node)
Map< const ICFGNode *, AbstractState > abstractTrace
per-node trace; owned here
virtual void storeValue(const ValVar *pointer, const AbstractValue &val, const ICFGNode *node)
const AddrToAbsValMap & getLocToVal() const
get loc2val map
void store(u32_t addr, const AbstractValue &val)
const Set< NodeID > & getFreedAddrs() const
virtual AbstractValue & load(u32_t addr)
static u32_t getVirtualMemAddress(u32_t idx)
The physical address starts with 0x7f...... + idx.
void addToFreedAddrs(NodeID addr)
void updateAddrStateOnly(const AbstractState &other)
Replace address-taken (ObjVar) state with other's, preserving ValVar state.
void join_with(const AbstractValue &other)
Map< const ICFGNode *, Map< NodeID, IntervalValue > > refinementTrace
void joinStates(AbstractState &dst, const AbstractState &src) override
bool isIntraEdgeBranchFeasible(const IntraCFGEdge *edge, const ICFGNode *src)
Return whether this intra edge is allowed by the current branch state.
bool mergeStatesFromPredecessors(const ICFGNode *node) override
bool isICFGPathFeasible(const ICFGNode *src, const ICFGNode *dst)
void storeValue(const ValVar *pointer, const AbstractValue &val, const ICFGNode *node) override
bool isIndirectSVFGEdgeFeasible(const IndirectSVFGEdge *edge, const VFGNode *dst)
std::unique_ptr< SVFGBuilder > svfgBuilder
void recordBranchRefinement(NodeID objId, const IntervalValue &narrowed, AbstractState &as, const ICFGNode *loadIcfg, const ICFGNode *succ) override
~FullSparseAbstractInterpretation() override
void buildSVFG()
Build the SVFG on top of the semi-sparse precompute.
void propagateAndApplyRefinement(const ICFGNode *node)
SVFG * svfg
View pointer into svfgBuilder's graph; non-null after buildSVFG().
void pullObjValueFlows(const ICFGNode *node)
NodeType * getGNode(NodeID id) const
Get a node.
const GEdgeSetTy & getOutEdges() const
const GEdgeSetTy & getInEdges() const
virtual const FunObjVar * getFun() const
Return the function of this ICFGNode.
const VFGNodeList & getVFGNodes() const
GlobalICFGNode * getGlobalICFGNode() const
NodeBS & getAllFieldsObjVars(const BaseObjVar *obj)
Get all fields of an object.
const SVFVar * getSVFVar(NodeID id) const
ObjVar/GepObjVar/BaseObjVar.
bool narrowCycleState(const AbstractState &prev, const AbstractState &cur, const ICFGCycleWTO *cycle) override
const AbstractValue & getAbsValue(const ValVar *var, const ICFGNode *node) override
AbstractState getFullCycleHeadState(const ICFGCycleWTO *cycle) override
void joinStates(AbstractState &dst, const AbstractState &src) override
bool widenCycleState(const AbstractState &prev, const AbstractState &cur, const ICFGCycleWTO *cycle) override
void updateAbsValue(const ValVar *var, const AbstractValue &val, const ICFGNode *node) override
bool hasAbsValue(const ValVar *var, const ICFGNode *node) const override
Side-effect-free existence check.
void updateAbsState(const ICFGNode *node, const AbstractState &state) override
const ICFGNode * getICFGNode(const ValVar *var) const
virtual const ICFGNode * getICFGNode() const
Return corresponding ICFG node.
llvm::IRBuilder IRBuilder