svf-lib 1.0.856 → 1.0.860

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.
@@ -329,7 +329,7 @@ public:
329
329
  }
330
330
  inline SVFStmt* getIntraPAGEdge(SVFVar* src, SVFVar* dst, SVFStmt::PEDGEK kind)
331
331
  {
332
- SVFStmt edge(src,dst,kind);
332
+ SVFStmt edge(src,dst,kind, false);
333
333
  const SVFStmt::SVFStmtSetTy& edgeSet = getSVFStmtSet(kind);
334
334
  SVFStmt::SVFStmtSetTy::const_iterator it = edgeSet.find(&edge);
335
335
  assert(it != edgeSet.end() && "can not find pag edge");
@@ -65,7 +65,7 @@ public:
65
65
  static u32_t totalEdgeNum; ///< Total edge number
66
66
 
67
67
  /// Constructor
68
- SVFStmt(SVFVar* s, SVFVar* d, GEdgeFlag k);
68
+ SVFStmt(SVFVar* s, SVFVar* d, GEdgeFlag k, bool real=true);
69
69
  /// Destructor
70
70
  ~SVFStmt()
71
71
  {
@@ -205,16 +205,14 @@ public:
205
205
  // TODO: ignore here:
206
206
  }
207
207
  //}@
208
- /// Compute offset of a gep instruction or gep constant expression
209
- bool computeGepOffset(const User *V, LocationSet& ls);
210
-
208
+
211
209
  protected:
212
210
  /// Handle globals including (global variable and functions)
213
211
  //@{
214
212
  void visitGlobal(SVFModule* svfModule);
215
213
  void InitialGlobal(const GlobalVariable *gvar, Constant *C,
216
214
  u32_t offset);
217
- NodeID getGlobalVarField(const GlobalVariable *gvar, u32_t offset);
215
+ NodeID getGlobalVarField(const GlobalVariable *gvar, u32_t offset, Type* tpy);
218
216
  //@}
219
217
 
220
218
  /// Process constant expression
@@ -223,6 +221,12 @@ protected:
223
221
  /// Infer field index from byteoffset.
224
222
  u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, s64_t idx);
225
223
 
224
+ /// Compute offset of a gep instruction or gep constant expression
225
+ bool computeGepOffset(const User *V, LocationSet& ls);
226
+
227
+ /// Get the base value of (i8* src and i8* dst) for external argument (e.g. memcpy(i8* dst, i8* src, int size))
228
+ const Value* getBaseValueForExtArg(const Value* V);
229
+
226
230
  /// Get the base type and max offset
227
231
  const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector<LocationSet> &fields, const Value* sz);
228
232
 
Binary file
@@ -329,7 +329,7 @@ public:
329
329
  }
330
330
  inline SVFStmt* getIntraPAGEdge(SVFVar* src, SVFVar* dst, SVFStmt::PEDGEK kind)
331
331
  {
332
- SVFStmt edge(src,dst,kind);
332
+ SVFStmt edge(src,dst,kind, false);
333
333
  const SVFStmt::SVFStmtSetTy& edgeSet = getSVFStmtSet(kind);
334
334
  SVFStmt::SVFStmtSetTy::const_iterator it = edgeSet.find(&edge);
335
335
  assert(it != edgeSet.end() && "can not find pag edge");
@@ -65,7 +65,7 @@ public:
65
65
  static u32_t totalEdgeNum; ///< Total edge number
66
66
 
67
67
  /// Constructor
68
- SVFStmt(SVFVar* s, SVFVar* d, GEdgeFlag k);
68
+ SVFStmt(SVFVar* s, SVFVar* d, GEdgeFlag k, bool real=true);
69
69
  /// Destructor
70
70
  ~SVFStmt()
71
71
  {
@@ -205,16 +205,14 @@ public:
205
205
  // TODO: ignore here:
206
206
  }
207
207
  //}@
208
- /// Compute offset of a gep instruction or gep constant expression
209
- bool computeGepOffset(const User *V, LocationSet& ls);
210
-
208
+
211
209
  protected:
212
210
  /// Handle globals including (global variable and functions)
213
211
  //@{
214
212
  void visitGlobal(SVFModule* svfModule);
215
213
  void InitialGlobal(const GlobalVariable *gvar, Constant *C,
216
214
  u32_t offset);
217
- NodeID getGlobalVarField(const GlobalVariable *gvar, u32_t offset);
215
+ NodeID getGlobalVarField(const GlobalVariable *gvar, u32_t offset, Type* tpy);
218
216
  //@}
219
217
 
220
218
  /// Process constant expression
@@ -223,6 +221,12 @@ protected:
223
221
  /// Infer field index from byteoffset.
224
222
  u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, s64_t idx);
225
223
 
224
+ /// Compute offset of a gep instruction or gep constant expression
225
+ bool computeGepOffset(const User *V, LocationSet& ls);
226
+
227
+ /// Get the base value of (i8* src and i8* dst) for external argument (e.g. memcpy(i8* dst, i8* src, int size))
228
+ const Value* getBaseValueForExtArg(const Value* V);
229
+
226
230
  /// Get the base type and max offset
227
231
  const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector<LocationSet> &fields, const Value* sz);
228
232
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.856",
3
+ "version": "1.0.860",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {