svf-tools 1.0.1030 → 1.0.1032

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 (33) hide show
  1. package/package.json +1 -1
  2. package/svf/include/Graphs/CHG.h +6 -5
  3. package/svf/include/Graphs/GenericGraph.h +23 -5
  4. package/svf/include/MemoryModel/PointerAnalysis.h +1 -1
  5. package/svf/include/MemoryModel/PointerAnalysisImpl.h +1 -1
  6. package/svf/include/SVFIR/SVFIR.h +14 -3
  7. package/svf/include/SVFIR/SVFValue.h +1 -4
  8. package/svf/include/SVFIR/SVFVariables.h +205 -10
  9. package/svf/lib/DDA/ContextDDA.cpp +1 -1
  10. package/svf/lib/DDA/DDAClient.cpp +6 -11
  11. package/svf/lib/Graphs/CHG.cpp +1 -1
  12. package/svf/lib/Graphs/ConsG.cpp +1 -1
  13. package/svf/lib/Graphs/VFG.cpp +9 -24
  14. package/svf/lib/MemoryModel/PointerAnalysis.cpp +23 -23
  15. package/svf/lib/SABER/SaberSVFGBuilder.cpp +1 -1
  16. package/svf/lib/SVFIR/SVFIR.cpp +5 -11
  17. package/svf/lib/SVFIR/SVFVariables.cpp +35 -10
  18. package/svf/lib/WPA/AndersenStat.cpp +2 -2
  19. package/svf/lib/WPA/FlowSensitiveStat.cpp +2 -2
  20. package/svf/lib/WPA/WPAPass.cpp +2 -2
  21. package/svf-llvm/include/SVF-LLVM/DCHG.h +5 -5
  22. package/svf-llvm/include/SVF-LLVM/SVFIRBuilder.h +1 -2
  23. package/svf-llvm/lib/CHGBuilder.cpp +6 -7
  24. package/svf-llvm/lib/DCHG.cpp +7 -4
  25. package/svf-llvm/lib/LLVMModule.cpp +1 -0
  26. package/svf-llvm/lib/LLVMUtil.cpp +19 -4
  27. package/svf-llvm/lib/SVFIRBuilder.cpp +28 -17
  28. package/svf-llvm/lib/SVFIRExtAPI.cpp +4 -1
  29. package/svf-llvm/tools/Example/svf-ex.cpp +1 -4
  30. package/svf-llvm/tools/LLVM2SVF/llvm2svf.cpp +1 -4
  31. package/svf-llvm/tools/WPA/wpa.cpp +1 -2
  32. package/svf/include/SVFIR/SVFFileSystem.h +0 -1318
  33. package/svf/lib/SVFIR/SVFFileSystem.cpp +0 -2338
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.1030",
3
+ "version": "1.0.1032",
4
4
  "description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -42,8 +42,9 @@ namespace SVF
42
42
 
43
43
  class SVFModule;
44
44
  class CHNode;
45
+ class GlobalObjVar;
45
46
 
46
- typedef Set<const SVFGlobalValue*> VTableSet;
47
+ typedef Set<const GlobalObjVar*> VTableSet;
47
48
  typedef Set<const SVFFunction*> VFunSet;
48
49
 
49
50
  /// Common base for class hierarchy graph. Only implements what PointerAnalysis needs.
@@ -127,7 +128,7 @@ public:
127
128
  ~CHNode()
128
129
  {
129
130
  }
130
- std::string getName() const
131
+ virtual const std::string& getName() const
131
132
  {
132
133
  return className;
133
134
  }
@@ -181,12 +182,12 @@ public:
181
182
  }
182
183
  void getVirtualFunctions(u32_t idx, FuncVector &virtualFunctions) const;
183
184
 
184
- const SVFGlobalValue *getVTable() const
185
+ const GlobalObjVar *getVTable() const
185
186
  {
186
187
  return vtable;
187
188
  }
188
189
 
189
- void setVTable(const SVFGlobalValue *vtbl)
190
+ void setVTable(const GlobalObjVar *vtbl)
190
191
  {
191
192
  vtable = vtbl;
192
193
  }
@@ -210,7 +211,7 @@ public:
210
211
  //@}
211
212
 
212
213
  private:
213
- const SVFGlobalValue* vtable;
214
+ const GlobalObjVar* vtable;
214
215
  std::string className;
215
216
  size_t flags;
216
217
  /*
@@ -160,12 +160,13 @@ public:
160
160
  RetNode, // ├──Represents a return value node
161
161
  VarargNode, // ├──Represents a variadic argument node
162
162
  GlobalValNode, // ├──Represents a global variable node
163
+ ConstantAggValNode, // ├──Represents a constant aggregate value node
163
164
  ConstantDataValNode, // ├──Represents a constant data variable
164
165
  BlackHoleNode, // ├──Represents a black hole node
165
166
  ConstantFPValNode, // ├──Represents a constant float-point value node
166
167
  ConstantIntValNode, // ├── Represents a constant integer value node
167
168
  ConstantNullptrValNode, // ├── Represents a constant nullptr value node
168
- DummyValNode, // ├──Dummy node for uninitialized values
169
+ DummyValNode, // ├──Represents a dummy node for uninitialized values
169
170
  // │ └── ObjVar: Classes of object variable nodes
170
171
  ObjNode, // ├──Represents an object variable
171
172
  GepObjNode, // ├──Represents a GEP object variable
@@ -175,6 +176,7 @@ public:
175
176
  HeapObjNode, // ├──Types of heap object
176
177
  StackObjNode, // ├──Types of stack object
177
178
  GlobalObjNode, // ├──Types of global object
179
+ ConstantAggObjNode, // ├──Types of constant aggregate object
178
180
  ConstantDataObjNode, // ├──Types of constant data object
179
181
  ConstantFPObjNode, // ├──Types of constant float-point object
180
182
  ConstantIntObjNode, // ├──Types of constant integer object
@@ -250,6 +252,21 @@ public:
250
252
  return type;
251
253
  }
252
254
 
255
+ inline virtual void setName(const std::string& nameInfo)
256
+ {
257
+ name = nameInfo;
258
+ }
259
+
260
+ inline virtual void setName(std::string&& nameInfo)
261
+ {
262
+ name = std::move(nameInfo);
263
+ }
264
+
265
+ virtual const std::string& getName() const
266
+ {
267
+ return name;
268
+ }
269
+
253
270
  inline virtual void setSourceLoc(const std::string& sourceCodeInfo)
254
271
  {
255
272
  sourceLoc = sourceCodeInfo;
@@ -268,6 +285,7 @@ protected:
268
285
  GNodeK nodeKind; ///< Node kind
269
286
  const SVFType* type; ///< SVF type
270
287
 
288
+ std::string name;
271
289
  std::string sourceLoc; ///< Source code information of this value
272
290
 
273
291
  /// Helper functions to check node kinds
@@ -290,7 +308,7 @@ protected:
290
308
 
291
309
  static inline bool isSVFVarKind(GNodeK n)
292
310
  {
293
- static_assert(DummyObjNode - ValNode == 24,
311
+ static_assert(DummyObjNode - ValNode == 26,
294
312
  "The number of SVFVarKinds has changed, make sure the "
295
313
  "range is correct");
296
314
 
@@ -299,7 +317,7 @@ protected:
299
317
 
300
318
  static inline bool isValVarKinds(GNodeK n)
301
319
  {
302
- static_assert(DummyValNode - ValNode == 12,
320
+ static_assert(DummyValNode - ValNode == 13,
303
321
  "The number of ValVarKinds has changed, make sure the "
304
322
  "range is correct");
305
323
  return n <= DummyValNode && n >= ValNode;
@@ -316,7 +334,7 @@ protected:
316
334
 
317
335
  static inline bool isObjVarKinds(GNodeK n)
318
336
  {
319
- static_assert(DummyObjNode - ObjNode == 11,
337
+ static_assert(DummyObjNode - ObjNode == 12,
320
338
  "The number of ObjVarKinds has changed, make sure the "
321
339
  "range is correct");
322
340
  return n <= DummyObjNode && n >= ObjNode;
@@ -324,7 +342,7 @@ protected:
324
342
 
325
343
  static inline bool isBaseObjVarKinds(GNodeK n)
326
344
  {
327
- static_assert(DummyObjNode - BaseObjNode == 9,
345
+ static_assert(DummyObjNode - BaseObjNode == 10,
328
346
  "The number of BaseObjVarKinds has changed, make sure the "
329
347
  "range is correct");
330
348
  return n <= DummyObjNode && n >= BaseObjNode;
@@ -104,7 +104,7 @@ public:
104
104
  typedef Set<const SVFFunction*> FunctionSet;
105
105
  typedef OrderedMap<const CallICFGNode*, FunctionSet> CallEdgeMap;
106
106
  typedef SCCDetection<PTACallGraph*> CallGraphSCC;
107
- typedef Set<const SVFGlobalValue*> VTableSet;
107
+ typedef Set<const GlobalObjVar*> VTableSet;
108
108
  typedef Set<const SVFFunction*> VFunSet;
109
109
  //@}
110
110
 
@@ -570,7 +570,7 @@ public:
570
570
  }
571
571
  else if (!SVFUtil::isa<DummyValVar>(node))
572
572
  {
573
- SVFUtil::outs() << "##<" << node->getValue()->getName() << "> ";
573
+ SVFUtil::outs() << "##<" << node->toString() << "> ";
574
574
  //SVFUtil::outs() << "Source Loc: " << SVFUtil::getSourceLoc(node->getValue());
575
575
  }
576
576
 
@@ -407,8 +407,7 @@ public:
407
407
  {
408
408
  const SVFVar* node = getGNode(id);
409
409
  if(const GepValVar* gepVar = SVFUtil::dyn_cast<GepValVar>(node))
410
- return SVFUtil::dyn_cast<ValVar>(
411
- getGNode(gepVar->getBaseNode()));
410
+ return gepVar->getBaseNode();
412
411
  else
413
412
  return SVFUtil::dyn_cast<ValVar>(node);
414
413
  }
@@ -590,6 +589,12 @@ private:
590
589
  return addNode(node);
591
590
  }
592
591
 
592
+ inline NodeID addConstantAggValNode(const SVFValue* curInst, const NodeID i, const ICFGNode* icfgNode)
593
+ {
594
+ SVFVar* node = new ConstantAggValVar(curInst, i, icfgNode);
595
+ return addNode(node);
596
+ }
597
+
593
598
  inline NodeID addConstantDataValNode(const SVFValue* curInst, const NodeID i, const ICFGNode* icfgNode)
594
599
  {
595
600
  SVFVar* node = new ConstantDataValVar(curInst, i, icfgNode);
@@ -661,7 +666,13 @@ private:
661
666
  GlobalObjVar* gObj = new GlobalObjVar(curInst, i, ti);
662
667
  return addObjNode(curInst, gObj);
663
668
  }
664
-
669
+ inline NodeID addConstantAggObjNode(const SVFValue* curInst,
670
+ const NodeID i, ObjTypeInfo* ti)
671
+ {
672
+ memToFieldsMap[i].set(i);
673
+ ConstantAggObjVar* conObj = new ConstantAggObjVar(curInst, i, ti);
674
+ return addObjNode(curInst, conObj);
675
+ }
665
676
  inline NodeID addConstantDataObjNode(const SVFValue* curInst, const NodeID i, ObjTypeInfo* ti)
666
677
  {
667
678
  memToFieldsMap[i].set(i);
@@ -244,10 +244,7 @@ public:
244
244
  {
245
245
  return name;
246
246
  }
247
- inline void setName(const std::string& n)
248
- {
249
- name = n;
250
- }
247
+
251
248
  inline void setName(std::string&& n)
252
249
  {
253
250
  name = std::move(n);
@@ -46,6 +46,7 @@ class SVFVar : public GenericPAGNodeTy
46
46
  {
47
47
  friend class SVFIRWriter;
48
48
  friend class SVFIRReader;
49
+ friend class SVFIRBuilder;
49
50
  friend class IRGraph;
50
51
  friend class SVFIR;
51
52
  friend class VFG;
@@ -68,11 +69,13 @@ protected:
68
69
  SVFStmt::KindToSVFStmtMapTy InEdgeKindToSetMap;
69
70
  SVFStmt::KindToSVFStmtMapTy OutEdgeKindToSetMap;
70
71
  bool isPtr; /// whether it is a pointer (top-level or address-taken)
72
+
71
73
  const SVFFunction* func; /// function containing this variable
72
74
 
73
75
  /// Constructor to create an empty object (for deserialization)
74
76
  SVFVar(NodeID i, PNODEK k) : GenericPAGNodeTy(i, k), value{} {}
75
77
 
78
+
76
79
  public:
77
80
  /// Constructor
78
81
  SVFVar(const SVFValue* val, NodeID i, PNODEK k);
@@ -109,7 +112,10 @@ public:
109
112
  }
110
113
  /// Whether it is constant data, i.e., "0", "1.001", "str"
111
114
  /// or llvm's metadata, i.e., metadata !4087
112
- bool isConstDataOrAggDataButNotNullPtr() const;
115
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
116
+ {
117
+ return false;
118
+ }
113
119
 
114
120
  /// Whether this is an isolated node on the SVFIR graph
115
121
  virtual bool isIsolatedNode() const;
@@ -216,6 +222,24 @@ public:
216
222
  return isSVFVarKind(node->getNodeKind());
217
223
  }
218
224
 
225
+ inline virtual bool ptrInUncalledFunction() const
226
+ {
227
+ if (const SVFFunction* fun = getFunction())
228
+ {
229
+ return fun->isUncalledFunction();
230
+ }
231
+ else
232
+ {
233
+ return false;
234
+ }
235
+ }
236
+
237
+ virtual bool isConstDataOrAggData() const
238
+ {
239
+ return false;
240
+ }
241
+
242
+
219
243
  private:
220
244
  /// add methods of the components
221
245
  //@{
@@ -465,7 +489,7 @@ class GepValVar: public ValVar
465
489
 
466
490
  private:
467
491
  AccessPath ap; // AccessPath
468
- NodeID base; // base node id
492
+ ValVar* base; // base node
469
493
  const SVFType* gepValType;
470
494
 
471
495
  /// Constructor to create empty GeValVar (for SVFIRReader/deserialization)
@@ -490,14 +514,15 @@ public:
490
514
  {
491
515
  return node->getNodeKind() == SVFVar::GepValNode;
492
516
  }
517
+ static inline bool classof(const SVFBaseNode* node)
518
+ {
519
+ return node->getNodeKind() == SVFVar::GepValNode;
520
+ }
493
521
  //@}
494
522
 
495
523
  /// Constructor
496
- GepValVar(NodeID baseID, const SVFValue* val, NodeID i, const AccessPath& ap,
497
- const SVFType* ty)
498
- : ValVar(val, i, GepValNode), ap(ap), base(baseID), gepValType(ty)
499
- {
500
- }
524
+ GepValVar(ValVar* baseNode, const SVFValue* val, NodeID i, const AccessPath& ap,
525
+ const SVFType* ty);
501
526
 
502
527
  /// offset of the base value variable
503
528
  inline APOffset getConstantFieldIdx() const
@@ -506,7 +531,7 @@ public:
506
531
  }
507
532
 
508
533
  /// Return the base object from which this GEP node came from.
509
- inline NodeID getBaseNode(void) const
534
+ inline ValVar* getBaseNode(void) const
510
535
  {
511
536
  return base;
512
537
  }
@@ -526,6 +551,20 @@ public:
526
551
  }
527
552
 
528
553
  virtual const std::string toString() const;
554
+
555
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
556
+ {
557
+ return base->isConstDataOrAggDataButNotNullPtr();
558
+ }
559
+ virtual inline bool ptrInUncalledFunction() const
560
+ {
561
+ return base->ptrInUncalledFunction();
562
+ }
563
+
564
+ virtual inline bool isConstDataOrAggData() const
565
+ {
566
+ return base->isConstDataOrAggData();
567
+ }
529
568
  };
530
569
 
531
570
  /*
@@ -716,7 +755,7 @@ public:
716
755
  {
717
756
  return typeInfo->isConstDataOrConstGlobal();
718
757
  }
719
- bool isConstDataOrAggData() const
758
+ virtual inline bool isConstDataOrAggData() const
720
759
  {
721
760
  return typeInfo->isConstDataOrAggData();
722
761
  }
@@ -781,7 +820,6 @@ public:
781
820
  const APOffset& apOffset, PNODEK ty = GepObjNode)
782
821
  : ObjVar(baseObj->hasValue()? baseObj->getValue(): nullptr, i, ty), apOffset(apOffset), base(baseObj)
783
822
  {
784
-
785
823
  }
786
824
 
787
825
  /// offset of the mem object
@@ -816,6 +854,21 @@ public:
816
854
  }
817
855
 
818
856
  virtual const std::string toString() const;
857
+
858
+ virtual inline bool ptrInUncalledFunction() const
859
+ {
860
+ return base->ptrInUncalledFunction();
861
+ }
862
+
863
+ virtual inline bool isConstDataOrAggData() const
864
+ {
865
+ return base->isConstDataOrAggData();
866
+ }
867
+
868
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
869
+ {
870
+ return base->isConstDataOrAggDataButNotNullPtr();
871
+ }
819
872
  };
820
873
 
821
874
 
@@ -1093,6 +1146,58 @@ public:
1093
1146
  virtual const std::string toString() const;
1094
1147
  };
1095
1148
 
1149
+ class ConstantAggValVar: public ValVar
1150
+ {
1151
+ friend class SVFIRWriter;
1152
+ friend class SVFIRReader;
1153
+
1154
+ public:
1155
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1156
+ //@{
1157
+ static inline bool classof(const ConstantAggValVar*)
1158
+ {
1159
+ return true;
1160
+ }
1161
+ static inline bool classof(const ValVar* node)
1162
+ {
1163
+ return node->getNodeKind() == ConstantAggValNode;
1164
+ }
1165
+ static inline bool classof(const SVFVar* node)
1166
+ {
1167
+ return node->getNodeKind() == ConstantAggValNode;
1168
+ }
1169
+ static inline bool classof(const GenericPAGNodeTy* node)
1170
+ {
1171
+ return node->getNodeKind() == ConstantAggValNode;
1172
+ }
1173
+ static inline bool classof(const SVFBaseNode* node)
1174
+ {
1175
+ return node->getNodeKind() == ConstantAggValNode;
1176
+ }
1177
+ //@}
1178
+
1179
+ /// Constructor
1180
+ ConstantAggValVar(const SVFValue* val, NodeID i, const ICFGNode* icn,
1181
+ PNODEK ty = ConstantAggValNode)
1182
+ : ValVar(val, i, ty, icn)
1183
+ {
1184
+
1185
+ }
1186
+
1187
+ virtual bool isConstDataOrAggData() const
1188
+ {
1189
+ return true;
1190
+ }
1191
+
1192
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1193
+ {
1194
+ return true;
1195
+ }
1196
+
1197
+ virtual const std::string toString() const;
1198
+ };
1199
+
1200
+
1096
1201
  class ConstantDataValVar: public ValVar
1097
1202
  {
1098
1203
  friend class SVFIRWriter;
@@ -1131,6 +1236,16 @@ public:
1131
1236
 
1132
1237
  }
1133
1238
 
1239
+ virtual bool isConstDataOrAggData() const
1240
+ {
1241
+ return true;
1242
+ }
1243
+
1244
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1245
+ {
1246
+ return true;
1247
+ }
1248
+
1134
1249
  virtual const std::string toString() const;
1135
1250
  };
1136
1251
 
@@ -1175,6 +1290,11 @@ public:
1175
1290
 
1176
1291
  }
1177
1292
 
1293
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1294
+ {
1295
+ return false;
1296
+ }
1297
+
1178
1298
  virtual const std::string toString() const
1179
1299
  {
1180
1300
  return "BlackHoleVar";
@@ -1333,6 +1453,11 @@ public:
1333
1453
 
1334
1454
  }
1335
1455
 
1456
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1457
+ {
1458
+ return false;
1459
+ }
1460
+
1336
1461
  virtual const std::string toString() const;
1337
1462
  };
1338
1463
 
@@ -1385,6 +1510,62 @@ public:
1385
1510
  virtual const std::string toString() const;
1386
1511
  };
1387
1512
 
1513
+ class ConstantAggObjVar: public BaseObjVar
1514
+ {
1515
+ friend class SVFIRWriter;
1516
+ friend class SVFIRReader;
1517
+
1518
+ public:
1519
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1520
+ //@{
1521
+ static inline bool classof(const ConstantAggObjVar*)
1522
+ {
1523
+ return true;
1524
+ }
1525
+ static inline bool classof(const BaseObjVar* node)
1526
+ {
1527
+ return node->getNodeKind() == ConstantAggObjNode;
1528
+ }
1529
+
1530
+ static inline bool classof(const ObjVar* node)
1531
+ {
1532
+ return node->getNodeKind() == ConstantAggObjNode;
1533
+ }
1534
+ static inline bool classof(const SVFVar* node)
1535
+ {
1536
+ return node->getNodeKind() == ConstantAggObjNode;
1537
+ }
1538
+ static inline bool classof(const GenericPAGNodeTy* node)
1539
+ {
1540
+ return node->getNodeKind() == ConstantAggObjNode;
1541
+ }
1542
+ static inline bool classof(const SVFBaseNode* node)
1543
+ {
1544
+ return node->getNodeKind() == ConstantAggObjNode;
1545
+ }
1546
+ //@}
1547
+
1548
+ /// Constructor
1549
+ ConstantAggObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti,
1550
+ PNODEK ty = ConstantAggObjNode)
1551
+ : BaseObjVar(val, i, ti, ty)
1552
+ {
1553
+
1554
+ }
1555
+
1556
+ virtual bool isConstDataOrAggData() const
1557
+ {
1558
+ return true;
1559
+ }
1560
+
1561
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1562
+ {
1563
+ return true;
1564
+ }
1565
+
1566
+ virtual const std::string toString() const;
1567
+ };
1568
+
1388
1569
  class ConstantDataObjVar: public BaseObjVar
1389
1570
  {
1390
1571
  friend class SVFIRWriter;
@@ -1429,6 +1610,16 @@ public:
1429
1610
  {
1430
1611
  }
1431
1612
 
1613
+ virtual bool isConstDataOrAggData() const
1614
+ {
1615
+ return true;
1616
+ }
1617
+
1618
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1619
+ {
1620
+ return true;
1621
+ }
1622
+
1432
1623
  virtual const std::string toString() const;
1433
1624
  };
1434
1625
 
@@ -1616,6 +1807,10 @@ public:
1616
1807
  {
1617
1808
  }
1618
1809
 
1810
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1811
+ {
1812
+ return false;
1813
+ }
1619
1814
 
1620
1815
  virtual const std::string toString() const;
1621
1816
  };
@@ -340,7 +340,7 @@ bool ContextDDA::isHeapCondMemObj(const CxtVar& var, const StoreSVFGNode*)
340
340
  assert(baseVar && "base object is null??");
341
341
  if (SVFUtil::isa<HeapObjVar, DummyObjVar>(baseVar))
342
342
  {
343
- if (!obj->getValue())
343
+ if (!isa<DummyObjVar>(baseVar))
344
344
  {
345
345
  PAGNode *pnode = _pag->getGNode(getPtrNodeID(var));
346
346
  GepObjVar* gepobj = SVFUtil::dyn_cast<GepObjVar>(pnode);
@@ -213,17 +213,12 @@ void AliasDDAClient::performStat(PointerAnalysis* pta)
213
213
  {
214
214
  const PAGNode* node1 = *lit;
215
215
  const PAGNode* node2 = *sit;
216
- if(node1->hasValue() && node2->hasValue())
217
- {
218
- AliasResult result = pta->alias(node1->getId(),node2->getId());
219
-
220
- outs() << "\n=================================================\n";
221
- outs() << "Alias Query for (" << node1->getValue()->toString() << ",";
222
- outs() << node2->getValue()->toString() << ") \n";
223
- outs() << "[NodeID:" << node1->getId() << ", NodeID:" << node2->getId() << " " << result << "]\n";
224
- outs() << "=================================================\n";
225
-
226
- }
216
+ AliasResult result = pta->alias(node1->getId(), node2->getId());
217
+ outs() << "\n=================================================\n";
218
+ outs() << "Alias Query for (" << node1->valueOnlyToString() << ",";
219
+ outs() << node2->valueOnlyToString() << ") \n";
220
+ outs() << "[NodeID:" << node1->getId() << ", NodeID:" << node2->getId() << " " << result << "]\n";
221
+ outs() << "=================================================\n";
227
222
  }
228
223
  }
229
224
  }
@@ -127,7 +127,7 @@ void CHGraph::getVFnsFromVtbls(const CallICFGNode* callsite, const VTableSet &vt
127
127
  size_t idx = callsite->getFunIdxInVtable();
128
128
  /// get the function name of the virtual callsite
129
129
  string funName = callsite->getFunNameOfVirtualCall();
130
- for (const SVFGlobalValue *vt : vtbls)
130
+ for (const GlobalObjVar *vt : vtbls)
131
131
  {
132
132
  const CHNode *child = getNode(vt->getName());
133
133
  if (child == nullptr)
@@ -775,7 +775,7 @@ struct DOTGraphTraits<ConstraintGraph*> : public DOTGraphTraits<SVFIR*>
775
775
  if (SVFUtil::isa<ValVar>(node))
776
776
  {
777
777
  if (nameDisplay)
778
- rawstr << node->getId() << ":" << node->getValueName();
778
+ rawstr << node->getId() << ":" << node->getName();
779
779
  else
780
780
  rawstr << node->getId();
781
781
  }