Skip to content

Commit

Permalink
fix asan bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bjjwwang committed Jan 26, 2025
1 parent 2dd6775 commit d97854b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions svf/include/Graphs/BasicBlockG.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ class SVFBasicBlock : public GenericBasicBlockNodeTy

inline void addSuccBasicBlock(const SVFBasicBlock* succ2)
{
// check if the edge already exists
for (auto edge: this->getOutEdges()) {
if (edge->getDstNode() == succ2)
return;
}

SVFBasicBlock* succ = const_cast<SVFBasicBlock*>(succ2);
BasicBlockEdge* edge = new BasicBlockEdge(this, succ);
this->addOutgoingEdge(edge);
Expand All @@ -148,6 +154,11 @@ class SVFBasicBlock : public GenericBasicBlockNodeTy

inline void addPredBasicBlock(const SVFBasicBlock* pred2)
{
// check if the edge already exists
for (auto edge: this->getInEdges()) {
if (edge->getSrcNode() == pred2)
return;
}
SVFBasicBlock* pred = const_cast<SVFBasicBlock*>(pred2);
BasicBlockEdge* edge = new BasicBlockEdge(pred, this);
this->addIncomingEdge(edge);
Expand Down

0 comments on commit d97854b

Please sign in to comment.