svf-lib 1.0.1683 → 1.0.1685

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.
@@ -84,7 +84,10 @@ public:
84
84
 
85
85
  virtual const std::string toString() const
86
86
  {
87
- return _icfgEdge->toString();
87
+ std::string str;
88
+ std::stringstream rawstr(str);
89
+ rawstr << "CFBBGEdge: [CFBBGNode" << getDstID() << " <-- CFBBGNode" << getSrcID() << "]\t";
90
+ return rawstr.str();
88
91
  }
89
92
 
90
93
  inline const ICFGEdge *getICFGEdge() const
@@ -578,13 +581,21 @@ struct DOTGraphTraits<SVF::CFBasicBlockGraph *> : public DOTGraphTraits<SVF::SVF
578
581
  {
579
582
  CFBasicBlockEdge* edge = *(EI.getCurrent());
580
583
  assert(edge && "No edge found!!");
581
- if (SVFUtil::isa<CallCFGEdge>(edge->getICFGEdge()))
582
- return "style=solid,color=red";
583
- else if (SVFUtil::isa<RetCFGEdge>(edge->getICFGEdge()))
584
- return "style=solid,color=blue";
584
+ if (edge->getICFGEdge())
585
+ {
586
+ if (SVFUtil::isa<CallCFGEdge>(edge->getICFGEdge()))
587
+ {
588
+ return "style=solid,color=red";
589
+ }
590
+ else if (SVFUtil::isa<RetCFGEdge>(edge->getICFGEdge()))
591
+ return "style=solid,color=blue";
592
+ else
593
+ return "style=solid";
594
+ }
585
595
  else
596
+ {
586
597
  return "style=solid";
587
- return "";
598
+ }
588
599
  }
589
600
 
590
601
  template<class EdgeIter>
@@ -595,11 +606,13 @@ struct DOTGraphTraits<SVF::CFBasicBlockGraph *> : public DOTGraphTraits<SVF::SVF
595
606
 
596
607
  std::string str;
597
608
  std::stringstream rawstr(str);
598
- if (const CallCFGEdge* dirCall = SVFUtil::dyn_cast<CallCFGEdge>(edge->getICFGEdge()))
599
- rawstr << dirCall->getCallSite();
600
- else if (const RetCFGEdge* dirRet = SVFUtil::dyn_cast<RetCFGEdge>(edge->getICFGEdge()))
601
- rawstr << dirRet->getCallSite();
602
-
609
+ if (edge->getICFGEdge())
610
+ {
611
+ if (const CallCFGEdge* dirCall = SVFUtil::dyn_cast<CallCFGEdge>(edge->getICFGEdge()))
612
+ rawstr << dirCall->getCallSite();
613
+ else if (const RetCFGEdge* dirRet = SVFUtil::dyn_cast<RetCFGEdge>(edge->getICFGEdge()))
614
+ rawstr << dirRet->getCallSite();
615
+ }
603
616
  return rawstr.str();
604
617
  }
605
618
  };
@@ -84,7 +84,10 @@ public:
84
84
 
85
85
  virtual const std::string toString() const
86
86
  {
87
- return _icfgEdge->toString();
87
+ std::string str;
88
+ std::stringstream rawstr(str);
89
+ rawstr << "CFBBGEdge: [CFBBGNode" << getDstID() << " <-- CFBBGNode" << getSrcID() << "]\t";
90
+ return rawstr.str();
88
91
  }
89
92
 
90
93
  inline const ICFGEdge *getICFGEdge() const
@@ -575,13 +578,21 @@ struct DOTGraphTraits<SVF::CFBasicBlockGraph *> : public DOTGraphTraits<SVF::SVF
575
578
  {
576
579
  CFBasicBlockEdge* edge = *(EI.getCurrent());
577
580
  assert(edge && "No edge found!!");
578
- if (SVFUtil::isa<CallCFGEdge>(edge->getICFGEdge()))
579
- return "style=solid,color=red";
580
- else if (SVFUtil::isa<RetCFGEdge>(edge->getICFGEdge()))
581
- return "style=solid,color=blue";
581
+ if (edge->getICFGEdge())
582
+ {
583
+ if (SVFUtil::isa<CallCFGEdge>(edge->getICFGEdge()))
584
+ {
585
+ return "style=solid,color=red";
586
+ }
587
+ else if (SVFUtil::isa<RetCFGEdge>(edge->getICFGEdge()))
588
+ return "style=solid,color=blue";
589
+ else
590
+ return "style=solid";
591
+ }
582
592
  else
593
+ {
583
594
  return "style=solid";
584
- return "";
595
+ }
585
596
  }
586
597
 
587
598
  template<class EdgeIter>
@@ -592,11 +603,13 @@ struct DOTGraphTraits<SVF::CFBasicBlockGraph *> : public DOTGraphTraits<SVF::SVF
592
603
 
593
604
  std::string str;
594
605
  std::stringstream rawstr(str);
595
- if (const CallCFGEdge* dirCall = SVFUtil::dyn_cast<CallCFGEdge>(edge->getICFGEdge()))
596
- rawstr << dirCall->getCallSite();
597
- else if (const RetCFGEdge* dirRet = SVFUtil::dyn_cast<RetCFGEdge>(edge->getICFGEdge()))
598
- rawstr << dirRet->getCallSite();
599
-
606
+ if (edge->getICFGEdge())
607
+ {
608
+ if (const CallCFGEdge* dirCall = SVFUtil::dyn_cast<CallCFGEdge>(edge->getICFGEdge()))
609
+ rawstr << dirCall->getCallSite();
610
+ else if (const RetCFGEdge* dirRet = SVFUtil::dyn_cast<RetCFGEdge>(edge->getICFGEdge()))
611
+ rawstr << dirRet->getCallSite();
612
+ }
600
613
  return rawstr.str();
601
614
  }
602
615
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1683",
3
+ "version": "1.0.1685",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {