svf-lib 1.0.2433 → 1.0.2435

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.
@@ -614,79 +614,79 @@ private:
614
614
 
615
615
 
616
616
  /// Add a memory obj node
617
- inline NodeID addObjNode(NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
617
+ inline NodeID addObjNode(NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
618
618
  {
619
- return addFIObjNode( i, ti, type, node);
619
+ return addFIObjNode( i, ti, node);
620
620
  }
621
621
 
622
622
  /**
623
623
  * Creates and adds a heap object node to the SVFIR
624
624
  */
625
- inline NodeID addHeapObjNode(NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
625
+ inline NodeID addHeapObjNode(NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
626
626
  {
627
627
  memToFieldsMap[i].set(i);
628
- HeapObjVar *heapObj = new HeapObjVar(i, ti, type, node);
628
+ HeapObjVar *heapObj = new HeapObjVar(i, ti, node);
629
629
  return addObjNode(heapObj);
630
630
  }
631
631
 
632
632
  /**
633
633
  * Creates and adds a stack object node to the SVFIR
634
634
  */
635
- inline NodeID addStackObjNode(NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
635
+ inline NodeID addStackObjNode(NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
636
636
  {
637
637
  memToFieldsMap[i].set(i);
638
- StackObjVar *stackObj = new StackObjVar(i, ti, type, node);
638
+ StackObjVar *stackObj = new StackObjVar(i, ti, node);
639
639
  return addObjNode(stackObj);
640
640
  }
641
641
 
642
- NodeID addFunObjNode(NodeID id, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
642
+ NodeID addFunObjNode(NodeID id, ObjTypeInfo* ti, const ICFGNode* node)
643
643
  {
644
644
  memToFieldsMap[id].set(id);
645
- FunObjVar* funObj = new FunObjVar(id, ti, type, node);
645
+ FunObjVar* funObj = new FunObjVar(id, ti, node);
646
646
  return addObjNode(funObj);
647
647
  }
648
648
 
649
649
 
650
- inline NodeID addConstantFPObjNode(NodeID i, ObjTypeInfo* ti, double dval, const SVFType* type, const ICFGNode* node)
650
+ inline NodeID addConstantFPObjNode(NodeID i, ObjTypeInfo* ti, double dval, const ICFGNode* node)
651
651
  {
652
652
  memToFieldsMap[i].set(i);
653
- ConstFPObjVar* conObj = new ConstFPObjVar(i, dval, ti, type, node);
653
+ ConstFPObjVar* conObj = new ConstFPObjVar(i, dval, ti, node);
654
654
  return addObjNode(conObj);
655
655
  }
656
656
 
657
657
 
658
- inline NodeID addConstantIntObjNode(NodeID i, ObjTypeInfo* ti, const std::pair<s64_t, u64_t>& intValue, const SVFType* type, const ICFGNode* node)
658
+ inline NodeID addConstantIntObjNode(NodeID i, ObjTypeInfo* ti, const std::pair<s64_t, u64_t>& intValue, const ICFGNode* node)
659
659
  {
660
660
  memToFieldsMap[i].set(i);
661
661
  ConstIntObjVar* conObj =
662
- new ConstIntObjVar(i, intValue.first, intValue.second, ti, type, node);
662
+ new ConstIntObjVar(i, intValue.first, intValue.second, ti, node);
663
663
  return addObjNode(conObj);
664
664
  }
665
665
 
666
666
 
667
- inline NodeID addConstantNullPtrObjNode(const NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
667
+ inline NodeID addConstantNullPtrObjNode(const NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
668
668
  {
669
669
  memToFieldsMap[i].set(i);
670
- ConstNullPtrObjVar* conObj = new ConstNullPtrObjVar(i, ti, type, node);
670
+ ConstNullPtrObjVar* conObj = new ConstNullPtrObjVar(i, ti, node);
671
671
  return addObjNode(conObj);
672
672
  }
673
673
 
674
- inline NodeID addGlobalObjNode(const NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
674
+ inline NodeID addGlobalObjNode(const NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
675
675
  {
676
676
  memToFieldsMap[i].set(i);
677
- GlobalObjVar* gObj = new GlobalObjVar(i, ti, type, node);
677
+ GlobalObjVar* gObj = new GlobalObjVar(i, ti, node);
678
678
  return addObjNode(gObj);
679
679
  }
680
- inline NodeID addConstantAggObjNode(const NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
680
+ inline NodeID addConstantAggObjNode(const NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
681
681
  {
682
682
  memToFieldsMap[i].set(i);
683
- ConstAggObjVar* conObj = new ConstAggObjVar(i, ti, type, node);
683
+ ConstAggObjVar* conObj = new ConstAggObjVar(i, ti, node);
684
684
  return addObjNode(conObj);
685
685
  }
686
- inline NodeID addConstantDataObjNode(const NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
686
+ inline NodeID addConstantDataObjNode(const NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
687
687
  {
688
688
  memToFieldsMap[i].set(i);
689
- ConstDataObjVar* conObj = new ConstDataObjVar(i, ti, type, node);
689
+ ConstDataObjVar* conObj = new ConstDataObjVar(i, ti, node);
690
690
  return addObjNode(conObj);
691
691
  }
692
692
 
@@ -708,10 +708,10 @@ private:
708
708
  /// Add a field obj node, this method can only invoked by getGepObjVar
709
709
  NodeID addGepObjNode(const BaseObjVar* baseObj, const APOffset& apOffset, const NodeID gepId);
710
710
  /// Add a field-insensitive node, this method can only invoked by getFIGepObjNode
711
- NodeID addFIObjNode(NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
711
+ NodeID addFIObjNode(NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
712
712
  {
713
713
  memToFieldsMap[i].set(i);
714
- BaseObjVar* baseObj = new BaseObjVar(i, ti, type, node);
714
+ BaseObjVar* baseObj = new BaseObjVar(i, ti, node);
715
715
  return addObjNode(baseObj);
716
716
  }
717
717
 
@@ -730,11 +730,11 @@ private:
730
730
  {
731
731
  ObjTypeInfo* ti = createObjTypeInfo(type);
732
732
  idToObjTypeInfoMap()[i] = ti;
733
- return addObjNode(new DummyObjVar(i, ti, nullptr, type));
733
+ return addObjNode(new DummyObjVar(i, ti, nullptr));
734
734
  }
735
735
  else
736
736
  {
737
- return addObjNode(new DummyObjVar(i, getObjTypeInfo(i), nullptr, type));
737
+ return addObjNode(new DummyObjVar(i, getObjTypeInfo(i), nullptr));
738
738
  }
739
739
  }
740
740
 
@@ -129,7 +129,7 @@ public:
129
129
  return edgeId;
130
130
  }
131
131
  /// Whether src and dst nodes are both of pointer type
132
- bool isPTAEdge() const;
132
+ virtual bool isPTAEdge() const;
133
133
 
134
134
  /// Get/set methods for llvm instruction
135
135
  //@{
@@ -343,6 +343,10 @@ public:
343
343
  return arrSize;
344
344
  }
345
345
 
346
+ virtual bool isPTAEdge() const override
347
+ {
348
+ return true;
349
+ }
346
350
  };
347
351
 
348
352
  /*!
@@ -533,9 +533,8 @@ public:
533
533
  //@}
534
534
 
535
535
  /// Constructor
536
- BaseObjVar(NodeID i, ObjTypeInfo* ti,
537
- const SVFType* svfType, const ICFGNode* node, PNODEK ty = BaseObjNode)
538
- : ObjVar(i, svfType, ty), typeInfo(ti), icfgNode(node)
536
+ BaseObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node, PNODEK ty = BaseObjNode)
537
+ : ObjVar(i, ti->getType(), ty), typeInfo(ti), icfgNode(node)
539
538
  {
540
539
  }
541
540
 
@@ -564,12 +563,6 @@ public:
564
563
  return id;
565
564
  }
566
565
 
567
- /// Get obj type
568
- const SVFType* getType() const
569
- {
570
- return typeInfo->getType();
571
- }
572
-
573
566
  /// Get the number of elements of this object
574
567
  u32_t getNumOfElements() const
575
568
  {
@@ -832,8 +825,8 @@ public:
832
825
  //@}
833
826
 
834
827
  /// Constructor
835
- HeapObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node):
836
- BaseObjVar(i, ti, svfType, node, HeapObjNode)
828
+ HeapObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node):
829
+ BaseObjVar(i, ti, node, HeapObjNode)
837
830
  {
838
831
  }
839
832
 
@@ -888,8 +881,8 @@ public:
888
881
  //@}
889
882
 
890
883
  /// Constructor
891
- StackObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node):
892
- BaseObjVar(i, ti, svfType, node, StackObjNode)
884
+ StackObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node):
885
+ BaseObjVar(i, ti, node, StackObjNode)
893
886
  {
894
887
  }
895
888
 
@@ -962,7 +955,7 @@ public:
962
955
  //@}
963
956
 
964
957
  /// Constructor
965
- FunObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node);
958
+ FunObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node);
966
959
 
967
960
 
968
961
  virtual ~FunObjVar()
@@ -1599,8 +1592,8 @@ public:
1599
1592
  //@}
1600
1593
 
1601
1594
  /// Constructor
1602
- GlobalObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node,
1603
- PNODEK ty = GlobalObjNode): BaseObjVar(i, ti, svfType, node, ty)
1595
+ GlobalObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node,
1596
+ PNODEK ty = GlobalObjNode): BaseObjVar(i, ti, node, ty)
1604
1597
  {
1605
1598
 
1606
1599
  }
@@ -1643,8 +1636,8 @@ public:
1643
1636
  //@}
1644
1637
 
1645
1638
  /// Constructor
1646
- ConstAggObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node)
1647
- : BaseObjVar(i, ti, svfType, node, ConstAggObjNode)
1639
+ ConstAggObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
1640
+ : BaseObjVar(i, ti, node, ConstAggObjNode)
1648
1641
  {
1649
1642
 
1650
1643
  }
@@ -1695,8 +1688,8 @@ public:
1695
1688
  //@}
1696
1689
 
1697
1690
  /// Constructor
1698
- ConstDataObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node, PNODEK ty = ConstDataObjNode)
1699
- : BaseObjVar(i, ti, svfType, node, ty)
1691
+ ConstDataObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node, PNODEK ty = ConstDataObjNode)
1692
+ : BaseObjVar(i, ti, node, ty)
1700
1693
  {
1701
1694
  }
1702
1695
 
@@ -1756,8 +1749,8 @@ public:
1756
1749
  //@}
1757
1750
 
1758
1751
  /// Constructor
1759
- ConstFPObjVar(NodeID i, double dv, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node)
1760
- : ConstDataObjVar(i, ti, svfType, node, ConstFPObjNode), dval(dv)
1752
+ ConstFPObjVar(NodeID i, double dv, ObjTypeInfo* ti, const ICFGNode* node)
1753
+ : ConstDataObjVar(i, ti, node, ConstFPObjNode), dval(dv)
1761
1754
  {
1762
1755
  }
1763
1756
 
@@ -1825,12 +1818,11 @@ public:
1825
1818
  //@}
1826
1819
 
1827
1820
  /// Constructor
1828
- ConstIntObjVar(NodeID i, s64_t sv, u64_t zv, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node)
1829
- : ConstDataObjVar(i, ti, svfType, node, ConstIntObjNode), zval(zv), sval(sv)
1821
+ ConstIntObjVar(NodeID i, s64_t sv, u64_t zv, ObjTypeInfo* ti, const ICFGNode* node)
1822
+ : ConstDataObjVar(i, ti, node, ConstIntObjNode), zval(zv), sval(sv)
1830
1823
  {
1831
1824
  }
1832
1825
 
1833
-
1834
1826
  virtual const std::string toString() const;
1835
1827
  };
1836
1828
 
@@ -1874,8 +1866,8 @@ public:
1874
1866
  //@}
1875
1867
 
1876
1868
  /// Constructor
1877
- ConstNullPtrObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node)
1878
- : ConstDataObjVar(i, ti, svfType, node, ConstNullptrObjNode)
1869
+ ConstNullPtrObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
1870
+ : ConstDataObjVar(i, ti, node, ConstNullptrObjNode)
1879
1871
  {
1880
1872
  }
1881
1873
  virtual bool isConstDataOrAggDataButNotNullPtr() const
@@ -2073,8 +2065,8 @@ public:
2073
2065
  //@}
2074
2066
 
2075
2067
  /// Constructor
2076
- DummyObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node, const SVFType* svfType = SVFType::getSVFPtrType())
2077
- : BaseObjVar(i, ti, svfType, node, DummyObjNode)
2068
+ DummyObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
2069
+ : BaseObjVar(i, ti, node, DummyObjNode)
2078
2070
  {
2079
2071
  }
2080
2072
 
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.2433",
3
+ "version": "1.0.2435",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {