svf-lib 1.0.1888 → 1.0.1890

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.
Files changed (29) hide show
  1. package/SVF-linux/Release-build/bin/ae +0 -0
  2. package/SVF-linux/Release-build/bin/cfl +0 -0
  3. package/SVF-linux/Release-build/bin/dvf +0 -0
  4. package/SVF-linux/Release-build/bin/llvm2svf +0 -0
  5. package/SVF-linux/Release-build/bin/mta +0 -0
  6. package/SVF-linux/Release-build/bin/saber +0 -0
  7. package/SVF-linux/Release-build/bin/svf-ex +0 -0
  8. package/SVF-linux/Release-build/bin/wpa +0 -0
  9. package/SVF-linux/Release-build/include/AE/Core/ICFGWTO.h +4 -0
  10. package/SVF-linux/Release-build/include/AE/Core/IntervalExeState.h +2 -0
  11. package/SVF-linux/Release-build/include/AE/Svfexe/AbstractExecution.h +31 -33
  12. package/SVF-linux/Release-build/include/Graphs/IRGraph.h +0 -1
  13. package/SVF-linux/Release-build/lib/libSvfCore.a +0 -0
  14. package/SVF-linux/Release-build/lib/libSvfLLVM.a +0 -0
  15. package/SVF-osx/Release-build/bin/ae +0 -0
  16. package/SVF-osx/Release-build/bin/svf-ex +0 -0
  17. package/SVF-osx/Release-build/include/AE/Core/ICFGWTO.h +4 -0
  18. package/SVF-osx/Release-build/include/AE/Core/IntervalExeState.h +2 -0
  19. package/SVF-osx/Release-build/include/AE/Svfexe/AbstractExecution.h +31 -33
  20. package/SVF-osx/Release-build/include/Graphs/IRGraph.h +0 -1
  21. package/SVF-osx/Release-build/lib/libSvfCore.a +0 -0
  22. package/SVF-osx/Release-build/lib/libSvfLLVM.a +0 -0
  23. package/package.json +1 -1
  24. package/SVF-linux/Release-build/include/AE/Core/CFBasicBlockGWTO.h +0 -85
  25. package/SVF-linux/Release-build/include/Graphs/CFBasicBlockG.h +0 -581
  26. package/SVF-linux/Release-build/include/Util/CFBasicBlockGBuilder.h +0 -64
  27. package/SVF-osx/Release-build/include/AE/Core/CFBasicBlockGWTO.h +0 -85
  28. package/SVF-osx/Release-build/include/Graphs/CFBasicBlockG.h +0 -581
  29. package/SVF-osx/Release-build/include/Util/CFBasicBlockGBuilder.h +0 -64
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -52,6 +52,10 @@ public:
52
52
 
53
53
  explicit ICFGWTO(ICFG* graph, const ICFGNode* node) : Base(graph, node) {}
54
54
 
55
+ virtual ~ICFGWTO()
56
+ {
57
+ }
58
+
55
59
  inline void forEachSuccessor(
56
60
  const ICFGNode* node,
57
61
  std::function<void(const ICFGNode*)> func) const override
@@ -433,6 +433,8 @@ public:
433
433
  return *this;
434
434
  }
435
435
 
436
+ virtual void printExprValues(std::ostream &oss) const override;
437
+
436
438
  /// move constructor
437
439
  IntervalExeState(IntervalExeState &&rhs) : IntervalESBase(std::move(rhs))
438
440
  {
@@ -32,7 +32,7 @@
32
32
  #include "AE/Svfexe/SVFIR2ItvExeState.h"
33
33
  #include "Util/WorkList.h"
34
34
  #include "MSSA/SVFGBuilder.h"
35
- #include "AE/Core/CFBasicBlockGWTO.h"
35
+ #include "AE/Core/ICFGWTO.h"
36
36
  #include "WPA/Andersen.h"
37
37
  #include "Util/SVFBugReport.h"
38
38
 
@@ -46,7 +46,7 @@ class AEAPI;
46
46
  enum class AEKind
47
47
  {
48
48
  AbstractExecution,
49
- BufOverflowChecker
49
+ BufOverflowChecker,
50
50
  };
51
51
 
52
52
  /// AEStat: Statistic for AE
@@ -120,7 +120,6 @@ public:
120
120
 
121
121
  virtual void runOnModule(SVFIR* svfModule);
122
122
 
123
-
124
123
  /// Destructor
125
124
  virtual ~AbstractExecution();
126
125
 
@@ -145,37 +144,37 @@ protected:
145
144
  void markRecursiveFuns();
146
145
 
147
146
  /**
148
- * Check if execution state exist by merging states of predecessor blocks
147
+ * Check if execution state exist by merging states of predecessor nodes
149
148
  *
150
- * @param block The basic block to analyse
151
- * @return if this block has preceding execution state
149
+ * @param node The ICFGNode to analyse
150
+ * @return if this node has preceding execution state
152
151
  */
153
- bool hasInEdgesES(const CFBasicBlockNode *block);
152
+ bool hasInEdgesES(const ICFGNode *node);
154
153
 
155
154
  /**
156
155
  * Check if execution state exist at the branch edge
157
156
  *
158
- * @param intraEdge the edge from CmpStmt to the next Block
157
+ * @param intraEdge the edge from CmpStmt to the next node
159
158
  * @return if this edge is feasible
160
159
  */
161
160
  bool hasBranchES(const IntraCFGEdge* intraEdge, IntervalExeState& es);
162
161
 
163
162
  /**
164
- * handle instructions in svf basic blocks
163
+ * handle instructions in ICFGNode
165
164
  *
166
165
  * @param block basic block that has a series of instructions
167
166
  */
168
- void handleBlock(const CFBasicBlockNode *block);
167
+ void handleWTONode(const ICFGNode* node);
169
168
 
170
169
  /**
171
- * handle one instruction in svf basic blocks
170
+ * handle one instruction in ICFGNode
172
171
  *
173
172
  * @param node ICFGNode which has a single instruction
174
173
  */
175
174
  virtual void handleICFGNode(const ICFGNode *node);
176
175
 
177
176
  /**
178
- * handle call node in svf basic blocks
177
+ * handle call node in ICFGNode
179
178
  *
180
179
  * @param node ICFGNode which has a single CallICFGNode
181
180
  */
@@ -186,7 +185,7 @@ protected:
186
185
  *
187
186
  * @param cycle WTOCycle which has weak topo order of basic blocks and nested cycles
188
187
  */
189
- virtual void handleCycle(const CFBasicBlockGWTOCycle *cycle);
188
+ virtual void handleCycle(const ICFGWTOCycle *cycle);
190
189
 
191
190
  /**
192
191
  * handle user defined function, ext function is not included.
@@ -221,7 +220,7 @@ protected:
221
220
  *
222
221
  * @param cmpStmt CmpStmt is a conditional branch statement
223
222
  * @param succ the value of cmpStmt (True or False)
224
- * @return if this block has preceding execution state
223
+ * @return if this ICFGNode has preceding execution state
225
224
  */
226
225
  bool hasCmpBranchES(const CmpStmt* cmpStmt, s64_t succ, IntervalExeState& es);
227
226
 
@@ -230,7 +229,7 @@ protected:
230
229
  *
231
230
  * @param var var in switch inst
232
231
  * @param succ the case value of switch inst
233
- * @return if this block has preceding execution state
232
+ * @return if this ICFGNode has preceding execution state
234
233
  */
235
234
  bool hasSwitchBranchES(const SVFVar* var, s64_t succ, IntervalExeState& es);
236
235
 
@@ -249,33 +248,32 @@ protected:
249
248
  SVFBugReport _recoder;
250
249
  std::vector<const CallICFGNode*> _callSiteStack;
251
250
  Map<const ICFGNode *, std::string> _nodeToBugInfo;
251
+ AndersenWaveDiff *_ander;
252
+ Map<const SVFFunction*, ICFGWTO *> _funcToWTO;
253
+ Set<const SVFFunction*> _recursiveFuns;
252
254
 
253
255
  private:
254
256
  // helper functions in handleCallSite
255
- bool isExtCall(const CallICFGNode* callNode);
256
- void extCallPass(const CallICFGNode* callNode);
257
- bool isRecursiveCall(const CallICFGNode* callNode);
258
- void recursiveCallPass(const CallICFGNode* callNode);
259
- bool isDirectCall(const CallICFGNode* callNode);
260
- void directCallFunPass(const CallICFGNode* callNode);
261
- bool isIndirectCall(const CallICFGNode* callNode);
262
- void indirectCallFunPass(const CallICFGNode* callNode);
257
+ virtual bool isExtCall(const CallICFGNode* callNode);
258
+ virtual void extCallPass(const CallICFGNode* callNode);
259
+ virtual bool isRecursiveCall(const CallICFGNode* callNode);
260
+ virtual void recursiveCallPass(const CallICFGNode* callNode);
261
+ virtual bool isDirectCall(const CallICFGNode* callNode);
262
+ virtual void directCallFunPass(const CallICFGNode* callNode);
263
+ virtual bool isIndirectCall(const CallICFGNode* callNode);
264
+ virtual void indirectCallFunPass(const CallICFGNode* callNode);
263
265
 
264
266
  // helper functions in hasInEdgesES
265
- bool isFunEntry(const CFBasicBlockNode* block);
266
- bool isGlobalEntry(const CFBasicBlockNode* block);
267
+ bool isFunEntry(const ICFGNode* node);
268
+ bool isGlobalEntry(const ICFGNode* node);
267
269
 
268
270
  // helper functions in handleCycle
269
- bool widenFixpointPass(const CFBasicBlockNode* cycle_head, IntervalExeState& pre_es);
270
- bool narrowFixpointPass(const CFBasicBlockNode* cycle_head, IntervalExeState& pre_es);
271
+ bool widenFixpointPass(const ICFGNode* cycle_head, IntervalExeState& pre_es);
272
+ bool narrowFixpointPass(const ICFGNode* cycle_head, IntervalExeState& pre_es);
271
273
 
272
274
  // private data
273
- CFBasicBlockGraph* _CFBlockG;
274
- AndersenWaveDiff *_ander;
275
- Map<const CFBasicBlockNode*, IntervalExeState> _preES;
276
- Map<const CFBasicBlockNode*, IntervalExeState> _postES;
277
- Map<const SVFFunction*, CFBasicBlockGWTO *> _funcToWTO;
278
- Set<const SVFFunction*> _recursiveFuns;
275
+ Map<const ICFGNode*, IntervalExeState> _preES;
276
+ Map<const ICFGNode*, IntervalExeState> _postES;
279
277
  std::string _moduleName;
280
278
 
281
279
  };
@@ -36,7 +36,6 @@
36
36
  #include "Util/NodeIDAllocator.h"
37
37
  #include "Util/SVFUtil.h"
38
38
  #include "Graphs/ICFG.h"
39
- #include "Graphs/CFBasicBlockG.h"
40
39
 
41
40
  namespace SVF
42
41
  {
Binary file
Binary file
@@ -52,6 +52,10 @@ public:
52
52
 
53
53
  explicit ICFGWTO(ICFG* graph, const ICFGNode* node) : Base(graph, node) {}
54
54
 
55
+ virtual ~ICFGWTO()
56
+ {
57
+ }
58
+
55
59
  inline void forEachSuccessor(
56
60
  const ICFGNode* node,
57
61
  std::function<void(const ICFGNode*)> func) const override
@@ -433,6 +433,8 @@ public:
433
433
  return *this;
434
434
  }
435
435
 
436
+ virtual void printExprValues(std::ostream &oss) const override;
437
+
436
438
  /// move constructor
437
439
  IntervalExeState(IntervalExeState &&rhs) : IntervalESBase(std::move(rhs))
438
440
  {
@@ -32,7 +32,7 @@
32
32
  #include "AE/Svfexe/SVFIR2ItvExeState.h"
33
33
  #include "Util/WorkList.h"
34
34
  #include "MSSA/SVFGBuilder.h"
35
- #include "AE/Core/CFBasicBlockGWTO.h"
35
+ #include "AE/Core/ICFGWTO.h"
36
36
  #include "WPA/Andersen.h"
37
37
  #include "Util/SVFBugReport.h"
38
38
 
@@ -46,7 +46,7 @@ class AEAPI;
46
46
  enum class AEKind
47
47
  {
48
48
  AbstractExecution,
49
- BufOverflowChecker
49
+ BufOverflowChecker,
50
50
  };
51
51
 
52
52
  /// AEStat: Statistic for AE
@@ -120,7 +120,6 @@ public:
120
120
 
121
121
  virtual void runOnModule(SVFIR* svfModule);
122
122
 
123
-
124
123
  /// Destructor
125
124
  virtual ~AbstractExecution();
126
125
 
@@ -145,37 +144,37 @@ protected:
145
144
  void markRecursiveFuns();
146
145
 
147
146
  /**
148
- * Check if execution state exist by merging states of predecessor blocks
147
+ * Check if execution state exist by merging states of predecessor nodes
149
148
  *
150
- * @param block The basic block to analyse
151
- * @return if this block has preceding execution state
149
+ * @param node The ICFGNode to analyse
150
+ * @return if this node has preceding execution state
152
151
  */
153
- bool hasInEdgesES(const CFBasicBlockNode *block);
152
+ bool hasInEdgesES(const ICFGNode *node);
154
153
 
155
154
  /**
156
155
  * Check if execution state exist at the branch edge
157
156
  *
158
- * @param intraEdge the edge from CmpStmt to the next Block
157
+ * @param intraEdge the edge from CmpStmt to the next node
159
158
  * @return if this edge is feasible
160
159
  */
161
160
  bool hasBranchES(const IntraCFGEdge* intraEdge, IntervalExeState& es);
162
161
 
163
162
  /**
164
- * handle instructions in svf basic blocks
163
+ * handle instructions in ICFGNode
165
164
  *
166
165
  * @param block basic block that has a series of instructions
167
166
  */
168
- void handleBlock(const CFBasicBlockNode *block);
167
+ void handleWTONode(const ICFGNode* node);
169
168
 
170
169
  /**
171
- * handle one instruction in svf basic blocks
170
+ * handle one instruction in ICFGNode
172
171
  *
173
172
  * @param node ICFGNode which has a single instruction
174
173
  */
175
174
  virtual void handleICFGNode(const ICFGNode *node);
176
175
 
177
176
  /**
178
- * handle call node in svf basic blocks
177
+ * handle call node in ICFGNode
179
178
  *
180
179
  * @param node ICFGNode which has a single CallICFGNode
181
180
  */
@@ -186,7 +185,7 @@ protected:
186
185
  *
187
186
  * @param cycle WTOCycle which has weak topo order of basic blocks and nested cycles
188
187
  */
189
- virtual void handleCycle(const CFBasicBlockGWTOCycle *cycle);
188
+ virtual void handleCycle(const ICFGWTOCycle *cycle);
190
189
 
191
190
  /**
192
191
  * handle user defined function, ext function is not included.
@@ -221,7 +220,7 @@ protected:
221
220
  *
222
221
  * @param cmpStmt CmpStmt is a conditional branch statement
223
222
  * @param succ the value of cmpStmt (True or False)
224
- * @return if this block has preceding execution state
223
+ * @return if this ICFGNode has preceding execution state
225
224
  */
226
225
  bool hasCmpBranchES(const CmpStmt* cmpStmt, s64_t succ, IntervalExeState& es);
227
226
 
@@ -230,7 +229,7 @@ protected:
230
229
  *
231
230
  * @param var var in switch inst
232
231
  * @param succ the case value of switch inst
233
- * @return if this block has preceding execution state
232
+ * @return if this ICFGNode has preceding execution state
234
233
  */
235
234
  bool hasSwitchBranchES(const SVFVar* var, s64_t succ, IntervalExeState& es);
236
235
 
@@ -249,33 +248,32 @@ protected:
249
248
  SVFBugReport _recoder;
250
249
  std::vector<const CallICFGNode*> _callSiteStack;
251
250
  Map<const ICFGNode *, std::string> _nodeToBugInfo;
251
+ AndersenWaveDiff *_ander;
252
+ Map<const SVFFunction*, ICFGWTO *> _funcToWTO;
253
+ Set<const SVFFunction*> _recursiveFuns;
252
254
 
253
255
  private:
254
256
  // helper functions in handleCallSite
255
- bool isExtCall(const CallICFGNode* callNode);
256
- void extCallPass(const CallICFGNode* callNode);
257
- bool isRecursiveCall(const CallICFGNode* callNode);
258
- void recursiveCallPass(const CallICFGNode* callNode);
259
- bool isDirectCall(const CallICFGNode* callNode);
260
- void directCallFunPass(const CallICFGNode* callNode);
261
- bool isIndirectCall(const CallICFGNode* callNode);
262
- void indirectCallFunPass(const CallICFGNode* callNode);
257
+ virtual bool isExtCall(const CallICFGNode* callNode);
258
+ virtual void extCallPass(const CallICFGNode* callNode);
259
+ virtual bool isRecursiveCall(const CallICFGNode* callNode);
260
+ virtual void recursiveCallPass(const CallICFGNode* callNode);
261
+ virtual bool isDirectCall(const CallICFGNode* callNode);
262
+ virtual void directCallFunPass(const CallICFGNode* callNode);
263
+ virtual bool isIndirectCall(const CallICFGNode* callNode);
264
+ virtual void indirectCallFunPass(const CallICFGNode* callNode);
263
265
 
264
266
  // helper functions in hasInEdgesES
265
- bool isFunEntry(const CFBasicBlockNode* block);
266
- bool isGlobalEntry(const CFBasicBlockNode* block);
267
+ bool isFunEntry(const ICFGNode* node);
268
+ bool isGlobalEntry(const ICFGNode* node);
267
269
 
268
270
  // helper functions in handleCycle
269
- bool widenFixpointPass(const CFBasicBlockNode* cycle_head, IntervalExeState& pre_es);
270
- bool narrowFixpointPass(const CFBasicBlockNode* cycle_head, IntervalExeState& pre_es);
271
+ bool widenFixpointPass(const ICFGNode* cycle_head, IntervalExeState& pre_es);
272
+ bool narrowFixpointPass(const ICFGNode* cycle_head, IntervalExeState& pre_es);
271
273
 
272
274
  // private data
273
- CFBasicBlockGraph* _CFBlockG;
274
- AndersenWaveDiff *_ander;
275
- Map<const CFBasicBlockNode*, IntervalExeState> _preES;
276
- Map<const CFBasicBlockNode*, IntervalExeState> _postES;
277
- Map<const SVFFunction*, CFBasicBlockGWTO *> _funcToWTO;
278
- Set<const SVFFunction*> _recursiveFuns;
275
+ Map<const ICFGNode*, IntervalExeState> _preES;
276
+ Map<const ICFGNode*, IntervalExeState> _postES;
279
277
  std::string _moduleName;
280
278
 
281
279
  };
@@ -36,7 +36,6 @@
36
36
  #include "Util/NodeIDAllocator.h"
37
37
  #include "Util/SVFUtil.h"
38
38
  #include "Graphs/ICFG.h"
39
- #include "Graphs/CFBasicBlockG.h"
40
39
 
41
40
  namespace SVF
42
41
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1888",
3
+ "version": "1.0.1890",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,85 +0,0 @@
1
- //===- CFBasicBlockGWTO.h -- WTO for CFBasicBlockGraph----------------------//
2
- //
3
- // SVF: Static Value-Flow Analysis
4
- //
5
- // Copyright (C) <2013-> <Yulei Sui>
6
- //
7
-
8
- // This program is free software: you can redistribute it and/or modify
9
- // it under the terms of the GNU General Public License as published by
10
- // the Free Software Foundation, either version 3 of the License, or
11
- // (at your option) any later version.
12
-
13
- // This program is distributed in the hope that it will be useful,
14
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- // GNU General Public License for more details.
17
-
18
- // You should have received a copy of the GNU General Public License
19
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
20
- //
21
- //===----------------------------------------------------------------------===//
22
-
23
- /*
24
- * CFBasicBlockGWTO.h
25
- *
26
- * The implementation is based on F. Bourdoncle's paper:
27
- * "Efficient chaotic iteration strategies with widenings", Formal
28
- * Methods in Programming and Their Applications, 1993, pages 128-141.
29
- *
30
- * Created on: Jan 22, 2024
31
- * Author: Xiao Cheng
32
- *
33
- */
34
- #ifndef SVF_CFBASICBLOCKGWTO_H
35
- #define SVF_CFBASICBLOCKGWTO_H
36
- #include "Graphs/CFBasicBlockG.h"
37
- #include "Graphs/WTO.h"
38
-
39
- namespace SVF
40
- {
41
- typedef WTOComponent<CFBasicBlockGraph> CFBasicBlockGWTOComp;
42
- typedef WTONode<CFBasicBlockGraph> CFBasicBlockGWTONode;
43
- typedef WTOCycle<CFBasicBlockGraph> CFBasicBlockGWTOCycle;
44
-
45
- class CFBasicBlockGWTO : public WTO<CFBasicBlockGraph>
46
- {
47
- public:
48
- typedef WTO<CFBasicBlockGraph> Base;
49
- typedef WTOComponentVisitor<CFBasicBlockGraph>::WTONodeT
50
- CFBasicBlockGWTONode;
51
-
52
- explicit CFBasicBlockGWTO(CFBasicBlockGraph* graph,
53
- const CFBasicBlockNode* node)
54
- : Base(graph, node)
55
- {
56
- }
57
-
58
- virtual ~CFBasicBlockGWTO() = default;
59
-
60
- inline void forEachSuccessor(
61
- const CFBasicBlockNode* node,
62
- std::function<void(const CFBasicBlockNode*)> func) const override
63
- {
64
- if (const auto* callNode =
65
- SVFUtil::dyn_cast<CallICFGNode>(node->getICFGNodes().front()))
66
- {
67
- const CFBasicBlockNode* succ = _graph->getCFBasicBlockNode(
68
- callNode->getRetICFGNode()->getId());
69
- func(succ);
70
- }
71
- else
72
- {
73
- for (const auto& e : node->getOutEdges())
74
- {
75
- if (e->getICFGEdge() &&
76
- (!e->getICFGEdge()->isIntraCFGEdge() ||
77
- node->getFunction() != e->getDstNode()->getFunction()))
78
- continue;
79
- func(e->getDstNode());
80
- }
81
- }
82
- }
83
- };
84
- } // namespace SVF
85
- #endif // SVF_CFBASICBLOCKGWTO_H