svf-lib 1.0.1268 → 1.0.1270

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.
@@ -209,6 +209,11 @@ public:
209
209
  {
210
210
  return globalBlockNode;
211
211
  }
212
+ inline void addGlobalICFGNode()
213
+ {
214
+ globalBlockNode = new GlobalICFGNode(totalICFGNode++);
215
+ addICFGNode(globalBlockNode);
216
+ }
212
217
  //@}
213
218
 
214
219
  private:
@@ -92,7 +92,7 @@ private:
92
92
  OrderedNodeSet candidatePointers;
93
93
  ICFG* icfg; // ICFG
94
94
  CallSiteSet callSiteSet; /// all the callsites of a program
95
-
95
+ SVFModule* svfModule; /// SVF Module
96
96
  /// Constructor
97
97
  SVFIR(bool buildFromFile);
98
98
 
@@ -128,9 +128,14 @@ public:
128
128
  {
129
129
  return GepObjVarMap;
130
130
  }
131
- /// Return ICFG
131
+ /// Set/Get ICFG
132
+ inline void setICFG(ICFG* i)
133
+ {
134
+ icfg = i;
135
+ }
132
136
  inline ICFG* getICFG()
133
137
  {
138
+ assert(icfg->totalICFGNode>0 && "empty ICFG! Build SVF IR first!");
134
139
  return icfg;
135
140
  }
136
141
  /// Return valid pointers
@@ -151,10 +156,15 @@ public:
151
156
  /// Whether to handle blackhole edge
152
157
  static void handleBlackHole(bool b);
153
158
  //@}
154
- /// Get LLVM Module
159
+ /// Set/Get LLVM Module
160
+ inline void setModule(SVFModule* mod)
161
+ {
162
+ svfModule = mod;
163
+ }
155
164
  inline SVFModule* getModule()
156
165
  {
157
- return SymbolTableInfo::SymbolInfo()->getModule();
166
+ assert(svfModule && "empty SVFModule! Build SVF IR first!");
167
+ return svfModule;
158
168
  }
159
169
  /// Get/set methods to get SVFStmts based on their kinds and ICFGNodes
160
170
  //@{
@@ -47,13 +47,13 @@ class SVFIRBuilder: public llvm::InstVisitor<SVFIRBuilder>
47
47
 
48
48
  private:
49
49
  SVFIR* pag;
50
- SVFModule* svfMod;
50
+ SVFModule* svfModule;
51
51
  const BasicBlock* curBB; ///< Current basic block during SVFIR construction when visiting the module
52
52
  const Value* curVal; ///< Current Value during SVFIR construction when visiting the module
53
53
 
54
54
  public:
55
55
  /// Constructor
56
- SVFIRBuilder(): pag(SVFIR::getPAG()), svfMod(nullptr), curBB(nullptr),curVal(nullptr)
56
+ SVFIRBuilder(SVFModule* mod): pag(SVFIR::getPAG()), svfModule(mod), curBB(nullptr),curVal(nullptr)
57
57
  {
58
58
  }
59
59
  /// Destructor
@@ -62,7 +62,7 @@ public:
62
62
  }
63
63
 
64
64
  /// Start building SVFIR here
65
- virtual SVFIR* build(SVFModule* svfModule);
65
+ virtual SVFIR* build();
66
66
 
67
67
  /// Return SVFIR
68
68
  SVFIR* getPAG() const
Binary file
@@ -79,6 +79,9 @@ public:
79
79
  /// Solving CFL Reachability
80
80
  virtual void solve();
81
81
 
82
+ /// Finalize extra stat info passing
83
+ virtual void finalize();
84
+
82
85
  /// Perform analyze (main part of CFLR Analysis)
83
86
  virtual void analyze();
84
87
 
@@ -95,7 +98,7 @@ public:
95
98
  static double numOfStartEdges; // Number of start nonterminal labeled edges
96
99
  // Solver
97
100
  static double numOfIteration; // Number solving Iteration
98
- static double numOfChecks; // Number of checks
101
+ static double numOfChecks; // Number of checks
99
102
  static double timeOfSolving; // time of solving CFL Reachability
100
103
  //@}
101
104
 
@@ -6,10 +6,10 @@ Productions:
6
6
  F -> epsilon | F copy | addr Memflow | F store V load | store Memflow load;
7
7
  Fbar -> epsilon | copybar Fbar | Memflowbar addrbar | loadbar V storebar Fbar | loadbar Memflowbar storebar;
8
8
  V -> Fbar V F | addrbar addr | gepbar_i V gep_i | gepbarpath V gep_0 | gepbar_i F gep_i | gepbar_i Fbar gep_i;
9
- copy -> vgep
9
+ copy -> vgep;
10
10
  copybar -> vgepbar;
11
11
  gep_1 -> gep_0 F vgep | gep_0 F gep_1;
12
12
  gepbar_1 -> gepbar_1 Fbar gepbar_0 | vgepbar Fbar gepbar_0;
13
13
  gepbarpath -> gepbar_0 gepbar_0 | gepbarpath gepbar_0;
14
- Memflow -> load store | Fbar Memflow | F Memflow Fbar | gep_i Memflow gepbar_i | gepbar_i Memflow gep_i;;
14
+ Memflow -> load store | Fbar Memflow | F Memflow Fbar | gep_i Memflow gepbar_i | gepbar_i Memflow gep_i;
15
15
  Memflowbar -> storebar loadbar | Memflowbar F | F Memflowbar Fbar | gep_i Memflowbar gepbar_i | gepbar_i Memflowbar gep_i;
@@ -5689,8 +5689,8 @@
5689
5689
  }
5690
5690
  },
5691
5691
  "_ZNSt5arrayIPK1ALm2EE4backEv":{
5692
- "return": "void",
5693
- "arguments": "()",
5692
+ "return": "%class.A** ",
5693
+ "arguments": "(%struct.std::array *)",
5694
5694
  "type": "CPP_EFT_DYNAMIC_CAST",
5695
5695
  "overwrite_app_function": 1,
5696
5696
  "GepStmt1": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1268",
3
+ "version": "1.0.1270",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {