@@ -84,7 +84,10 @@ class CFBasicBlockEdge : public GenericCFBasicBlockEdgeTy
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,16 @@ 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" ;
585
- else
584
+ if (edge->getICFGEdge ()) {
585
+ if (SVFUtil::isa<CallCFGEdge>(edge->getICFGEdge ())){
586
+ return " style=solid,color=red" ;}
587
+ else if (SVFUtil::isa<RetCFGEdge>(edge->getICFGEdge ()))
588
+ return " style=solid,color=blue" ;
589
+ else
590
+ return " style=solid" ;
591
+ } else {
586
592
return " style=solid" ;
587
- return " " ;
593
+ }
588
594
}
589
595
590
596
template <class EdgeIter >
@@ -595,11 +601,12 @@ struct DOTGraphTraits<SVF::CFBasicBlockGraph *> : public DOTGraphTraits<SVF::SVF
595
601
596
602
std::string str;
597
603
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
-
604
+ if (edge->getICFGEdge ()) {
605
+ if (const CallCFGEdge* dirCall = SVFUtil::dyn_cast<CallCFGEdge>(edge->getICFGEdge ()))
606
+ rawstr << dirCall->getCallSite ();
607
+ else if (const RetCFGEdge* dirRet = SVFUtil::dyn_cast<RetCFGEdge>(edge->getICFGEdge ()))
608
+ rawstr << dirRet->getCallSite ();
609
+ }
603
610
return rawstr.str ();
604
611
}
605
612
};
0 commit comments