Skip to content

Commit

Permalink
Merge pull request #1223 from jumormt/10.9
Browse files Browse the repository at this point in the history
fix control dependence bug: no nearest common post dominator
  • Loading branch information
yuleisui authored Oct 12, 2023
2 parents 519f05e + 4ea1ba3 commit 09ecc98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions svf/lib/SVFIR/SVFValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ const SVFBasicBlock* SVFLoopAndDomInfo::findNearestCommonPDominator(const SVFBas
// continue going up til we arrive at the same node.
while (A != B)
{
// no common PDominator
if(A == NULL) return NULL;
const auto lvA = getBBPDomLevel().find(A);
const auto lvB = getBBPDomLevel().find(B);
assert(lvA != getBBPDomLevel().end() && lvB != getBBPDomLevel().end());
Expand Down
5 changes: 5 additions & 0 deletions svf/lib/Util/CDGBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ void
CDGBuilder::extractNodesBetweenPdomNodes(const SVFBasicBlock *succ, const SVFBasicBlock *LCA,
std::vector<const SVFBasicBlock *> &tgtNodes)
{
if (LCA == NULL)
{
tgtNodes.push_back(succ);
return;
}
if (succ == LCA) return;
std::vector<const SVFBasicBlock *> path;
SVFLoopAndDomInfo *ld = const_cast<SVFFunction *>(LCA->getFunction())->getLoopAndDomInfo();
Expand Down

0 comments on commit 09ecc98

Please sign in to comment.