svf-tools 1.0.944 → 1.0.945

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.944",
3
+ "version": "1.0.945",
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": {
@@ -41,8 +41,8 @@ namespace SVF
41
41
  {
42
42
 
43
43
  typedef WTOComponent<ICFG> ICFGWTOComp;
44
- typedef WTONode<ICFG> ICFGWTONode;
45
- typedef WTOCycle<ICFG> ICFGWTOCycle;
44
+ typedef WTONode<ICFG> ICFGSingletonWTO;
45
+ typedef WTOCycle<ICFG> ICFGCycleWTO;
46
46
 
47
47
  class ICFGWTO : public WTO<ICFG>
48
48
  {
@@ -157,11 +157,11 @@ protected:
157
157
  bool isBranchFeasible(const IntraCFGEdge* intraEdge, AbstractState& as);
158
158
 
159
159
  /**
160
- * handle instructions in ICFGNode
160
+ * handle instructions in ICFGSingletonWTO
161
161
  *
162
- * @param block basic block that has a series of instructions
162
+ * @param block basic block that has one instruction or a series of instructions
163
163
  */
164
- virtual void handleWTONode(const ICFGNode* node);
164
+ virtual void handleWTONode(const ICFGSingletonWTO *icfgSingletonWto);
165
165
 
166
166
  /**
167
167
  * handle one instruction in ICFGNode
@@ -182,7 +182,7 @@ protected:
182
182
  *
183
183
  * @param cycle WTOCycle which has weak topo order of basic blocks and nested cycles
184
184
  */
185
- virtual void handleCycle(const ICFGWTOCycle* cycle);
185
+ virtual void handleCycle(const ICFGCycleWTO* cycle);
186
186
 
187
187
  /**
188
188
  * handle user defined function, ext function is not included.
@@ -395,21 +395,21 @@ public:
395
395
 
396
396
  private:
397
397
  /// Head of the cycle
398
- const NodeT* _head;
398
+ const WTONode<GraphT>* _head;
399
399
 
400
400
  /// List of components
401
401
  WTOComponentRefList _components;
402
402
 
403
403
  public:
404
404
  /// Constructor
405
- WTOCycle(const NodeT* head, WTOComponentRefList components)
405
+ WTOCycle(const WTONode<GraphT>* head, WTOComponentRefList components)
406
406
  : WTOComponent<GraphT>(WTOComponent<GraphT>::Cycle), _head(head),
407
407
  _components(std::move(components))
408
408
  {
409
409
  }
410
410
 
411
411
  /// Return the head of the cycle
412
- const NodeT* head() const
412
+ const WTONode<GraphT>* head() const
413
413
  {
414
414
  return _head;
415
415
  }
@@ -451,7 +451,7 @@ public:
451
451
  std::string str;
452
452
  std::stringstream rawstr(str);
453
453
  rawstr << "(";
454
- rawstr << _head->getId() << ", ";
454
+ rawstr << _head->node()->getId() << ", ";
455
455
  for (auto it = begin(), et = end(); it != et;)
456
456
  {
457
457
  rawstr << (*it)->toString();
@@ -687,7 +687,7 @@ protected:
687
687
 
688
688
  void visit(const WTOCycleT& cycle) override
689
689
  {
690
- const NodeT* head = cycle.head();
690
+ const NodeT* head = cycle.head()->node();
691
691
  WTOCycleDepthPtr previous_cycleDepth = _wtoCycleDepth;
692
692
  _nodeToWTOCycleDepth.insert(std::make_pair(head, _wtoCycleDepth));
693
693
  _wtoCycleDepth =
@@ -765,7 +765,7 @@ protected:
765
765
  return ptr;
766
766
  }
767
767
 
768
- const WTOCycleT* newCycle(const NodeT* node,
768
+ const WTOCycleT* newCycle(const WTONodeT* node,
769
769
  const WTOComponentRefList& partition)
770
770
  {
771
771
  const WTOCycleT* ptr = new WTOCycleT(node, std::move(partition));
@@ -784,7 +784,8 @@ protected:
784
784
  visit(succ, partition);
785
785
  }
786
786
  });
787
- const WTOCycleT* ptr = newCycle(node, partition);
787
+ const WTONodeT* head = newNode(node);
788
+ const WTOCycleT* ptr = newCycle(head, partition);
788
789
  headRefToCycle.emplace(node, ptr);
789
790
  return ptr;
790
791
  }
@@ -518,8 +518,9 @@ bool AbstractInterpretation::isBranchFeasible(const IntraCFGEdge* intraEdge,
518
518
  return true;
519
519
  }
520
520
  /// handle instructions in svf basic blocks
521
- void AbstractInterpretation::handleWTONode(const ICFGNode *node)
521
+ void AbstractInterpretation::handleWTONode(const ICFGSingletonWTO *icfgSingletonWto)
522
522
  {
523
+ const ICFGNode* node = icfgSingletonWto->node();
523
524
  _stat->getBlockTrace()++;
524
525
  // Get execution states from in edges
525
526
  if (!propagateStateIfFeasible(node))
@@ -690,30 +691,28 @@ void AbstractInterpretation::handleICFGNode(const ICFGNode *curICFGNode)
690
691
  }
691
692
 
692
693
  /// handle wto cycle (loop)
693
- void AbstractInterpretation::handleCycle(const ICFGWTOCycle *cycle)
694
+ void AbstractInterpretation::handleCycle(const ICFGCycleWTO*cycle)
694
695
  {
695
696
  // Get execution states from in edges
696
- if (!propagateStateIfFeasible(cycle->head()))
697
+ if (!propagateStateIfFeasible(cycle->head()->node()))
697
698
  {
698
699
  // No ES on the in edges - Infeasible block
699
700
  return;
700
701
  }
701
- AbstractState pre_es = _preAbsTrace[cycle->head()];
702
+ AbstractState pre_es = _preAbsTrace[cycle->head()->node()];
702
703
  // set -widen-delay
703
704
  s32_t widen_delay = Options::WidenDelay();
704
705
  bool incresing = true;
705
706
  for (int i = 0; ; i++)
706
707
  {
707
- const ICFGNode* cycle_head = cycle->head();
708
- // handle cycle head
709
- handleWTONode(cycle_head);
708
+ handleWTONode(cycle->head());
710
709
  if (i < widen_delay)
711
710
  {
712
- if (i> 0 && pre_es >= _postAbsTrace[cycle_head])
711
+ if (i> 0 && pre_es >= _postAbsTrace[cycle->head()->node()])
713
712
  {
714
713
  break;
715
714
  }
716
- pre_es = _postAbsTrace[cycle_head];
715
+ pre_es = _postAbsTrace[cycle->head()->node()];
717
716
  }
718
717
  else
719
718
  {
@@ -722,7 +721,7 @@ void AbstractInterpretation::handleCycle(const ICFGWTOCycle *cycle)
722
721
  if (incresing)
723
722
  {
724
723
  bool is_fixpoint =
725
- isFixPointAfterWidening(cycle_head, pre_es);
724
+ isFixPointAfterWidening(cycle->head()->node(), pre_es);
726
725
  if (is_fixpoint)
727
726
  {
728
727
  incresing = false;
@@ -732,7 +731,7 @@ void AbstractInterpretation::handleCycle(const ICFGWTOCycle *cycle)
732
731
  else if (!incresing)
733
732
  {
734
733
  bool is_fixpoint =
735
- isFixPointAfterNarrowing(cycle_head, pre_es);
734
+ isFixPointAfterNarrowing(cycle->head()->node(), pre_es);
736
735
  if (is_fixpoint)
737
736
  break;
738
737
  }
@@ -741,11 +740,11 @@ void AbstractInterpretation::handleCycle(const ICFGWTOCycle *cycle)
741
740
  for (auto it = cycle->begin(); it != cycle->end(); ++it)
742
741
  {
743
742
  const ICFGWTOComp* cur = *it;
744
- if (const ICFGWTONode* vertex = SVFUtil::dyn_cast<ICFGWTONode>(cur))
743
+ if (const ICFGSingletonWTO* vertex = SVFUtil::dyn_cast<ICFGSingletonWTO>(cur))
745
744
  {
746
- handleWTONode(vertex->node());
745
+ handleWTONode(vertex);
747
746
  }
748
- else if (const ICFGWTOCycle* cycle2 = SVFUtil::dyn_cast<ICFGWTOCycle>(cur))
747
+ else if (const ICFGCycleWTO* cycle2 = SVFUtil::dyn_cast<ICFGCycleWTO>(cur))
749
748
  {
750
749
  handleCycle(cycle2);
751
750
  }
@@ -813,11 +812,11 @@ void AbstractInterpretation::handleFunc(const SVFFunction *func)
813
812
  for (auto it = wto->begin(); it!= wto->end(); ++it)
814
813
  {
815
814
  const ICFGWTOComp* cur = *it;
816
- if (const ICFGWTONode* vertex = SVFUtil::dyn_cast<ICFGWTONode>(cur))
815
+ if (const ICFGSingletonWTO* vertex = SVFUtil::dyn_cast<ICFGSingletonWTO>(cur))
817
816
  {
818
- handleWTONode(vertex->node());
817
+ handleWTONode(vertex);
819
818
  }
820
- else if (const ICFGWTOCycle* cycle = SVFUtil::dyn_cast<ICFGWTOCycle>(cur))
819
+ else if (const ICFGCycleWTO* cycle = SVFUtil::dyn_cast<ICFGCycleWTO>(cur))
821
820
  {
822
821
  handleCycle(cycle);
823
822
  }