svf-lib 1.0.2414 → 1.0.2416
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SVF-osx/bin/ae +0 -0
- package/SVF-osx/bin/cfl +0 -0
- package/SVF-osx/bin/dvf +0 -0
- package/SVF-osx/bin/llvm2svf +0 -0
- package/SVF-osx/bin/mta +0 -0
- package/SVF-osx/bin/saber +0 -0
- package/SVF-osx/bin/svf-ex +0 -0
- package/SVF-osx/bin/wpa +0 -0
- package/SVF-osx/include/AE/Core/ICFGWTO.h +17 -48
- package/SVF-osx/include/Graphs/WTO.h +11 -7
- package/SVF-osx/lib/libSvfCore.3.2.dylib +0 -0
- package/SVF-osx/lib/libSvfLLVM.3.2.dylib +0 -0
- package/package.json +1 -1
package/SVF-osx/bin/ae
CHANGED
|
Binary file
|
package/SVF-osx/bin/cfl
CHANGED
|
Binary file
|
package/SVF-osx/bin/dvf
CHANGED
|
Binary file
|
package/SVF-osx/bin/llvm2svf
CHANGED
|
Binary file
|
package/SVF-osx/bin/mta
CHANGED
|
Binary file
|
package/SVF-osx/bin/saber
CHANGED
|
Binary file
|
package/SVF-osx/bin/svf-ex
CHANGED
|
Binary file
|
package/SVF-osx/bin/wpa
CHANGED
|
Binary file
|
|
@@ -45,75 +45,43 @@ typedef WTOComponent<ICFG> ICFGWTOComp;
|
|
|
45
45
|
typedef WTONode<ICFG> ICFGSingletonWTO;
|
|
46
46
|
typedef WTOCycle<ICFG> ICFGCycleWTO;
|
|
47
47
|
|
|
48
|
+
// Added for IWTO
|
|
48
49
|
class ICFGWTO : public WTO<ICFG>
|
|
49
50
|
{
|
|
50
51
|
public:
|
|
51
52
|
typedef WTO<ICFG> Base;
|
|
52
53
|
typedef WTOComponentVisitor<ICFG>::WTONodeT ICFGWTONode;
|
|
54
|
+
Set<const FunObjVar*> scc;
|
|
53
55
|
|
|
54
|
-
explicit ICFGWTO(ICFG* graph,
|
|
55
|
-
|
|
56
|
-
virtual ~ICFGWTO()
|
|
56
|
+
explicit ICFGWTO(ICFG* graph,const ICFGNode* node, Set<const FunObjVar*> funcScc = {}) :
|
|
57
|
+
Base(graph, node), scc(funcScc)
|
|
57
58
|
{
|
|
59
|
+
if (scc.empty()) // if empty funcScc, default use the function of the node
|
|
60
|
+
scc.insert(node->getFun());
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
const ICFGNode* node,
|
|
62
|
-
std::function<void(const ICFGNode*)> func) const override
|
|
63
|
+
virtual ~ICFGWTO()
|
|
63
64
|
{
|
|
64
|
-
if (const auto* callNode = SVFUtil::dyn_cast<CallICFGNode>(node))
|
|
65
|
-
{
|
|
66
|
-
const ICFGNode* succ = callNode->getRetICFGNode();
|
|
67
|
-
func(succ);
|
|
68
|
-
}
|
|
69
|
-
else
|
|
70
|
-
{
|
|
71
|
-
for (const auto& e : node->getOutEdges())
|
|
72
|
-
{
|
|
73
|
-
if (!e->isIntraCFGEdge() ||
|
|
74
|
-
node->getFun() != e->getDstNode()->getFun())
|
|
75
|
-
continue;
|
|
76
|
-
func(e->getDstNode());
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
65
|
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
// Added for IWTO
|
|
83
|
-
class ICFGIWTO : public ICFGWTO
|
|
84
|
-
{
|
|
85
|
-
public:
|
|
86
|
-
typedef ICFGWTO Base;
|
|
87
|
-
typedef WTOComponentVisitor<ICFG>::WTONodeT ICFGWTONode;
|
|
88
|
-
NodeBS &funcPar;
|
|
89
|
-
CallGraph *cg;
|
|
90
|
-
|
|
91
|
-
explicit ICFGIWTO(ICFG* graph, const ICFGNode* node, NodeBS & funcPar, CallGraph* cg) :
|
|
92
|
-
Base(graph, node), funcPar(funcPar), cg(cg) {}
|
|
93
66
|
|
|
94
|
-
virtual
|
|
67
|
+
inline virtual std::vector<const ICFGNode*> getSuccessors(const ICFGNode* node) override
|
|
95
68
|
{
|
|
96
|
-
|
|
69
|
+
std::vector<const ICFGNode*> successors;
|
|
97
70
|
|
|
98
|
-
inline void forEachSuccessor(
|
|
99
|
-
const ICFGNode* node,
|
|
100
|
-
std::function<void(const ICFGNode*)> func) const override
|
|
101
|
-
{
|
|
102
71
|
if (const auto* callNode = SVFUtil::dyn_cast<CallICFGNode>(node))
|
|
103
72
|
{
|
|
104
73
|
|
|
105
74
|
for (const auto &e : callNode->getOutEdges())
|
|
106
75
|
{
|
|
107
76
|
ICFGNode *calleeEntryICFGNode = e->getDstNode();
|
|
108
|
-
|
|
77
|
+
const ICFGNode *succ = nullptr;
|
|
109
78
|
|
|
110
|
-
|
|
111
|
-
if (funcPar.test(calleeCGNode->getId()))
|
|
79
|
+
if (scc.find(calleeEntryICFGNode->getFun()) != scc.end()) // caller & callee in the same SCC
|
|
112
80
|
succ = calleeEntryICFGNode;
|
|
113
81
|
else
|
|
114
|
-
succ = callNode->getRetICFGNode();
|
|
82
|
+
succ = callNode->getRetICFGNode(); // caller & callee in different SCC
|
|
115
83
|
|
|
116
|
-
|
|
84
|
+
successors.push_back(succ);
|
|
117
85
|
}
|
|
118
86
|
}
|
|
119
87
|
else
|
|
@@ -121,12 +89,13 @@ public:
|
|
|
121
89
|
for (const auto& e : node->getOutEdges())
|
|
122
90
|
{
|
|
123
91
|
ICFGNode *succ = e->getDstNode();
|
|
124
|
-
|
|
125
|
-
if (!funcPar.test(succCGNode->getId()))
|
|
92
|
+
if (scc.find(succ->getFun()) == scc.end()) // if not in the same SCC, skip
|
|
126
93
|
continue;
|
|
127
|
-
|
|
94
|
+
successors.push_back(succ);
|
|
128
95
|
}
|
|
129
96
|
}
|
|
97
|
+
|
|
98
|
+
return successors;
|
|
130
99
|
}
|
|
131
100
|
};
|
|
132
101
|
|
|
@@ -720,13 +720,15 @@ protected:
|
|
|
720
720
|
}; // end class WTOCycleDepthBuilder
|
|
721
721
|
|
|
722
722
|
protected:
|
|
723
|
-
|
|
724
|
-
inline virtual
|
|
723
|
+
/// Return the successors of node
|
|
724
|
+
inline virtual std::vector<const NodeT *> getSuccessors(const NodeT* node)
|
|
725
725
|
{
|
|
726
|
+
std::vector<const NodeT *> succssors;
|
|
726
727
|
for (const auto& e : node->getOutEdges())
|
|
727
728
|
{
|
|
728
|
-
|
|
729
|
+
succssors.push_back(e->getDstNode());
|
|
729
730
|
}
|
|
731
|
+
return succssors;
|
|
730
732
|
}
|
|
731
733
|
|
|
732
734
|
protected:
|
|
@@ -788,13 +790,14 @@ protected:
|
|
|
788
790
|
virtual const WTOCycleT* component(const NodeT* node)
|
|
789
791
|
{
|
|
790
792
|
WTOComponentRefList partition;
|
|
791
|
-
|
|
793
|
+
|
|
794
|
+
for (auto succ: getSuccessors(node))
|
|
792
795
|
{
|
|
793
796
|
if (getCDN(succ) == 0)
|
|
794
797
|
{
|
|
795
798
|
visit(succ, partition);
|
|
796
799
|
}
|
|
797
|
-
}
|
|
800
|
+
}
|
|
798
801
|
const WTONodeT* head = newNode(node);
|
|
799
802
|
const WTOCycleT* ptr = newCycle(head, partition);
|
|
800
803
|
headRefToCycle.emplace(node, ptr);
|
|
@@ -816,7 +819,8 @@ protected:
|
|
|
816
819
|
head = _num;
|
|
817
820
|
setCDN(node, head);
|
|
818
821
|
loop = false;
|
|
819
|
-
|
|
822
|
+
|
|
823
|
+
for (auto succ: getSuccessors(node))
|
|
820
824
|
{
|
|
821
825
|
CycleDepthNumber succ_dfn = getCDN(succ);
|
|
822
826
|
if (succ_dfn == CycleDepthNumber(0))
|
|
@@ -832,7 +836,7 @@ protected:
|
|
|
832
836
|
head = min;
|
|
833
837
|
loop = true;
|
|
834
838
|
}
|
|
835
|
-
}
|
|
839
|
+
}
|
|
836
840
|
|
|
837
841
|
if (head == getCDN(node))
|
|
838
842
|
{
|
|
Binary file
|
|
Binary file
|