svf-lib 1.0.1943 → 1.0.1945

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.
Binary file
Binary file
@@ -154,7 +154,7 @@ protected:
154
154
  * @param intraEdge the edge from CmpStmt to the next node
155
155
  * @return if this edge is feasible
156
156
  */
157
- bool isBranchFeasible(const IntraCFGEdge* intraEdge, AbstractState& es);
157
+ bool isBranchFeasible(const IntraCFGEdge* intraEdge, AbstractState& as);
158
158
 
159
159
  /**
160
160
  * handle instructions in ICFGNode
@@ -214,7 +214,7 @@ protected:
214
214
  * @return if this ICFGNode has preceding execution state
215
215
  */
216
216
  bool isCmpBranchFeasible(const CmpStmt* cmpStmt, s64_t succ,
217
- AbstractState& es);
217
+ AbstractState& as);
218
218
 
219
219
  /**
220
220
  * Check if this SwitchInst and succ are satisfiable to the execution state.
@@ -224,7 +224,7 @@ protected:
224
224
  * @return if this ICFGNode has preceding execution state
225
225
  */
226
226
  bool isSwitchBranchFeasible(const SVFVar* var, s64_t succ,
227
- AbstractState& es);
227
+ AbstractState& as);
228
228
 
229
229
 
230
230
  /**
@@ -248,7 +248,7 @@ protected:
248
248
  * @param addr Address Stmt like malloc/calloc/ALLOCA/StackAlloc
249
249
  * @return the byte size e.g. int32_t a[10] -> return 40
250
250
  */
251
- u32_t getAllocaInstByteSize(AbstractState& es, const AddrStmt *addr);
251
+ u32_t getAllocaInstByteSize(AbstractState& as, const AddrStmt *addr);
252
252
 
253
253
  /**
254
254
  * get byte size of alloca inst
@@ -257,7 +257,7 @@ protected:
257
257
  * @param rhs SVFValue of string
258
258
  * @return the string
259
259
  */
260
- std::string strRead(AbstractState& es,const SVFValue* rhs);
260
+ std::string strRead(AbstractState& as,const SVFValue* rhs);
261
261
 
262
262
  /**
263
263
  * get length of string
@@ -266,7 +266,7 @@ protected:
266
266
  * @param strValue SVFValue of string
267
267
  * @return AbstractValue of string length
268
268
  */
269
- AbstractValue getStrlen(AbstractState& es, const SVF::SVFValue *strValue);
269
+ AbstractValue getStrlen(AbstractState& as, const SVF::SVFValue *strValue);
270
270
 
271
271
  /**
272
272
  * get memory allocation size
@@ -277,7 +277,7 @@ protected:
277
277
  * @param value to be traced
278
278
  * @return AbstractValue of allocation size
279
279
  */
280
- AbstractValue traceMemoryAllocationSize(AbstractState& es, const SVFValue *value);
280
+ AbstractValue traceMemoryAllocationSize(AbstractState& as, const SVFValue *value);
281
281
  /**
282
282
  * execute strcpy in abstract execution
283
283
  * e.g arr = new char[10]
@@ -304,7 +304,7 @@ protected:
304
304
  * we can set arr[3]='d', arr[4]='e', arr[5]='\0'
305
305
  * @param call callnode of memcpy like api
306
306
  */
307
- virtual void handleMemcpy(AbstractState& es, const SVFValue* dst, const SVFValue* src, AbstractValue len, u32_t start_idx);
307
+ virtual void handleMemcpy(AbstractState& as, const SVFValue* dst, const SVFValue* src, AbstractValue len, u32_t start_idx);
308
308
  /**
309
309
  * execute memset in abstract execution
310
310
  * e.g arr = new char[10]
@@ -312,7 +312,7 @@ protected:
312
312
  * we can set arr[0]='c', arr[1]='c', arr[2]='\0'
313
313
  * @param call callnode of memset like api
314
314
  */
315
- virtual void handleMemset(AbstractState& es, const SVFValue* dst, AbstractValue elem, AbstractValue len);
315
+ virtual void handleMemset(AbstractState& as, const SVFValue* dst, AbstractValue elem, AbstractValue len);
316
316
 
317
317
  /**
318
318
  * if this NodeID in SVFIR is a pointer, get the pointee type
@@ -321,14 +321,14 @@ protected:
321
321
  * we can set arr[0]='c', arr[1]='c', arr[2]='\0'
322
322
  * @param call callnode of memset like api
323
323
  */
324
- const SVFType* getPointeeElement(AbstractState& es, NodeID id);
324
+ const SVFType* getPointeeElement(AbstractState& as, NodeID id);
325
325
 
326
326
  void collectCheckPoint();
327
327
  void checkPointAllSet();
328
328
  // helper functions for traceMemoryAllocationSize and canSafelyAccessMemory
329
329
  void AccessMemoryViaRetNode(const CallICFGNode *callnode, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited);
330
330
  void AccessMemoryViaCopyStmt(const CopyStmt *copy, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited);
331
- void AccessMemoryViaLoadStmt(AbstractState& es, const LoadStmt *load, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited);
331
+ void AccessMemoryViaLoadStmt(AbstractState& as, const LoadStmt *load, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited);
332
332
  void AccessMemoryViaCallArgs(const SVF::SVFArgument *arg, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited);
333
333
 
334
334
 
@@ -369,7 +369,7 @@ protected:
369
369
  bool narrowFixpointPass(const ICFGNode* cycle_head,
370
370
  AbstractState& pre_es);
371
371
 
372
- AbstractState& getState(const ICFGNode* node)
372
+ AbstractState& getAbsState(const ICFGNode* node)
373
373
  {
374
374
  const ICFGNode* repNode = _icfg->getRepNode(node);
375
375
  if (_postAbsTrace.count(repNode) == 0)
@@ -67,24 +67,24 @@ public:
67
67
  /// Return the value range of Integer SVF Type, e.g. unsigned i8 Type->[0, 255], signed i8 Type->[-128, 127]
68
68
  AbstractValue getRangeLimitFromType(const SVFType* type);
69
69
 
70
- AbstractValue getZExtValue(AbstractState& es, const SVFVar* var);
71
- AbstractValue getSExtValue(AbstractState& es, const SVFVar* var);
72
- AbstractValue getFPToSIntValue(AbstractState& es, const SVFVar* var);
73
- AbstractValue getFPToUIntValue(AbstractState& es, const SVFVar* var);
74
- AbstractValue getSIntToFPValue(AbstractState& es, const SVFVar* var);
75
- AbstractValue getUIntToFPValue(AbstractState& es, const SVFVar* var);
76
- AbstractValue getTruncValue(AbstractState& es, const SVFVar* var, const SVFType* dstType);
77
- AbstractValue getFPTruncValue(AbstractState& es, const SVFVar* var, const SVFType* dstType);
70
+ AbstractValue getZExtValue(const AbstractState& es, const SVFVar* var);
71
+ AbstractValue getSExtValue(const AbstractState& es, const SVFVar* var);
72
+ AbstractValue getFPToSIntValue(const AbstractState& es, const SVFVar* var);
73
+ AbstractValue getFPToUIntValue(const AbstractState& es, const SVFVar* var);
74
+ AbstractValue getSIntToFPValue(const AbstractState& es, const SVFVar* var);
75
+ AbstractValue getUIntToFPValue(const AbstractState& es, const SVFVar* var);
76
+ AbstractValue getTruncValue(const AbstractState& es, const SVFVar* var, const SVFType* dstType);
77
+ AbstractValue getFPTruncValue(const AbstractState& es, const SVFVar* var, const SVFType* dstType);
78
78
 
79
79
  /// Return the byte offset expression of a GepStmt
80
80
  /// elemBytesize is the element byte size of an static alloc or heap alloc array
81
81
  /// e.g. GepStmt* gep = [i32*10], x, and x is [0,3]
82
82
  /// std::pair<s32_t, s32_t> byteOffset = getByteOffset(gep);
83
83
  /// byteOffset should be [0, 12] since i32 is 4 bytes.
84
- AbstractValue getByteOffset(AbstractState& es, const GepStmt *gep);
84
+ AbstractValue getByteOffset(const AbstractState& es, const GepStmt *gep);
85
85
 
86
86
  /// Return the offset expression of a GepStmt
87
- AbstractValue getItvOfFlattenedElemIndex(AbstractState& es, const GepStmt *gep);
87
+ AbstractValue getItvOfFlattenedElemIndex(const AbstractState& es, const GepStmt *gep);
88
88
 
89
89
 
90
90
  static z3::context &getContext()
@@ -111,26 +111,26 @@ public:
111
111
 
112
112
 
113
113
  /// whether the variable is in varToVal table
114
- inline bool inVarToValTable(AbstractState& es, u32_t id) const
114
+ inline bool inVarToValTable(const AbstractState& es, u32_t id) const
115
115
  {
116
116
  return es.inVarToValTable(id);
117
117
  }
118
118
 
119
119
  /// whether the variable is in varToAddrs table
120
- inline bool inVarToAddrsTable(AbstractState& es, u32_t id) const
120
+ inline bool inVarToAddrsTable(const AbstractState& es, u32_t id) const
121
121
  {
122
122
  return es.inVarToAddrsTable(id);
123
123
  }
124
124
 
125
125
 
126
126
  /// whether the memory address stores a interval value
127
- inline bool inLocToValTable(AbstractState& es, u32_t id) const
127
+ inline bool inLocToValTable(const AbstractState& es, u32_t id) const
128
128
  {
129
129
  return es.inLocToValTable(id);
130
130
  }
131
131
 
132
132
  /// whether the memory address stores memory addresses
133
- inline bool inLocToAddrsTable(AbstractState& es, u32_t id) const
133
+ inline bool inLocToAddrsTable(const AbstractState& es, u32_t id) const
134
134
  {
135
135
  return es.inLocToAddrsTable(id);
136
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1943",
3
+ "version": "1.0.1945",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {