svf-lib 1.0.1508 → 1.0.1510

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.
@@ -69,6 +69,8 @@ public:
69
69
  typedef Map<NodeOffset,NodeID> NodeOffsetMap;
70
70
  typedef Map<NodeLocationSet,NodeID> NodeLocationSetMap;
71
71
  typedef Map<const SVFValue*, NodeLocationSetMap> GepValueVarMap;
72
+ typedef std::pair<const SVFType*, std::vector<LocationSet>> SVFTypeLocSetsPair;
73
+ typedef Map<NodeID, SVFTypeLocSetsPair> TypeLocSetsMap;
72
74
  typedef Map<NodePair,NodeID> NodePairSetMap;
73
75
 
74
76
  private:
@@ -77,6 +79,7 @@ private:
77
79
  ICFGNode2SVFStmtsMap icfgNode2SVFStmtsMap; ///< Map an ICFGNode to its SVFStmts
78
80
  ICFGNode2SVFStmtsMap icfgNode2PTASVFStmtsMap; ///< Map an ICFGNode to its PointerAnalysis related SVFStmts
79
81
  GepValueVarMap GepValObjMap; ///< Map a pair<base,off> to a gep value node id
82
+ TypeLocSetsMap typeLocSetsMap; ///< Map an arg to its base SVFType* and all its field location sets
80
83
  NodeLocationSetMap GepObjVarMap; ///< Map a pair<base,off> to a gep obj node id
81
84
  MemObjToFieldsMap memToFieldsMap; ///< Map a mem object id to all its fields
82
85
  SVFStmtSet globSVFStmtSet; ///< Global PAGEdges without control flow information
@@ -218,6 +221,16 @@ public:
218
221
  if (edge->isPTAEdge())
219
222
  icfgNode2PTASVFStmtsMap[inst].push_back(edge);
220
223
  }
224
+ /// Add a base SVFType* and all its field location sets to an arg NodeId
225
+ inline void addToTypeLocSetsMap(NodeID argId, SVFTypeLocSetsPair& locSets)
226
+ {
227
+ typeLocSetsMap[argId]=locSets;
228
+ }
229
+ /// Given an arg NodeId, get its base SVFType* and all its field location sets
230
+ inline SVFTypeLocSetsPair& getTypeLocSetsMap(NodeID argId)
231
+ {
232
+ return typeLocSetsMap[argId];
233
+ }
221
234
  /// Get global PAGEdges (not in a procedure)
222
235
  inline SVFStmtSet& getGlobalSVFStmtSet()
223
236
  {
@@ -306,6 +306,9 @@ public:
306
306
  // Assuming hasStatic(F), does (F) have a second static Y where X -> Y?
307
307
  bool has_static2(const SVFFunction *F);
308
308
 
309
+ // Does (F) have a memset_like or memcpy_like operation?
310
+ bool is_memset_or_memcpy(const SVFFunction *F);
311
+
309
312
  // Does (F) allocate a new object and return it?
310
313
  bool is_alloc(const SVFFunction *F);
311
314
 
@@ -5096,13 +5096,6 @@
5096
5096
  "dst": "Ret"
5097
5097
  }
5098
5098
  },
5099
- "dlsym": {
5100
- "return": "void *",
5101
- "arguments": "(void *, const char *)",
5102
- "type": "EFT_L_A1__FunPtr",
5103
- "overwrite_app_function": 0,
5104
- "funptr_ops": ["Arg1"]
5105
- },
5106
5099
  "bcopy": {
5107
5100
  "return": "void",
5108
5101
  "arguments": "(const void *, void *, size_t)",
@@ -299,6 +299,12 @@ inline bool isExtCall(const SVFFunction* fun)
299
299
  return fun && ExtAPI::getExtAPI()->is_ext(fun);
300
300
  }
301
301
 
302
+ // Return true if extern function contains memset_like or memcpy_like operations
303
+ inline bool isMemSetOrCpyExtFun(const SVFFunction* fun)
304
+ {
305
+ return fun && ExtAPI::getExtAPI()->is_memset_or_memcpy(fun);
306
+ }
307
+
302
308
  /// Return true if the call is a heap allocator/reallocator
303
309
  //@{
304
310
  /// note that these two functions are not suppose to be used externally
@@ -235,9 +235,10 @@ protected:
235
235
 
236
236
  /// Handle external call
237
237
  //@{
238
- virtual void parseOperations(std::vector<ExtAPI::Operation> &operations, CallBase* cs);
239
- virtual void handleExtCall(CallBase* cs, const Function *F);
240
- void addComplexConsForExt(const Value* D, const Value* S, const Value* sz);
238
+ virtual void parseOperations(std::vector<ExtAPI::Operation> &operations, const SVFCallInst* svfcall);
239
+ virtual void preProcessExtCall(CallBase* cs);
240
+ virtual void handleExtCall(SVFInstruction* svfinst, const SVFFunction* svfcallee);
241
+ void addComplexConsForExt(const SVFValue* D, const SVFValue* S, const SVFValue* sz);
241
242
  //@}
242
243
 
243
244
  /// Set current basic block in order to keep track of control flow information
@@ -281,7 +282,7 @@ protected:
281
282
  return nullPtr;
282
283
  }
283
284
 
284
- NodeID getGepValVar(const Value* val, const LocationSet& ls, const SVFType* baseType);
285
+ NodeID getGepValVar(const SVFValue* val, const LocationSet& ls, const SVFType* baseType);
285
286
 
286
287
  void setCurrentBBAndValueForPAGEdge(PAGEdge* edge);
287
288
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1508",
3
+ "version": "1.0.1510",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {