summaryrefslogtreecommitdiff
path: root/basicblock.cpp
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2017-06-28 22:12:14 -0400
committerJordan Wiens <jordan@psifertex.com>2017-06-28 22:12:14 -0400
commit980e2f090fb47f7f71a46b03e8c636819f3214ec (patch)
treef981eaf7f74eebc382974def5acc997cc9a215bd /basicblock.cpp
parentc51f3bed6bdef577253feee0e85a71fda1931bd7 (diff)
parentd3a401da5af8dd471adf842b63c7368c7f8e87d0 (diff)
Merging dev to master for linux demo fix -- will not change personal or
commercial builds
Diffstat (limited to 'basicblock.cpp')
-rw-r--r--basicblock.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/basicblock.cpp b/basicblock.cpp
index 7eb37c57..c2a2bddf 100644
--- a/basicblock.cpp
+++ b/basicblock.cpp
@@ -125,6 +125,7 @@ vector<BasicBlockEdge> BasicBlock::GetOutgoingEdges() const
BasicBlockEdge edge;
edge.type = array[i].type;
edge.target = array[i].target ? new BasicBlock(BNNewBasicBlockReference(array[i].target)) : nullptr;
+ edge.backEdge = array[i].backEdge;
result.push_back(edge);
}
@@ -144,6 +145,7 @@ vector<BasicBlockEdge> BasicBlock::GetIncomingEdges() const
BasicBlockEdge edge;
edge.type = array[i].type;
edge.target = array[i].target ? new BasicBlock(BNNewBasicBlockReference(array[i].target)) : nullptr;
+ edge.backEdge = array[i].backEdge;
result.push_back(edge);
}
@@ -397,5 +399,10 @@ void BasicBlock::SetUserBasicBlockHighlight(uint8_t r, uint8_t g, uint8_t b, uin
bool BasicBlock::IsBackEdge(BasicBlock* source, BasicBlock* target)
{
- return source->GetDominators().count(target) != 0;
+ for (auto& i : source->GetOutgoingEdges())
+ {
+ if (i.target->GetObject() == target->GetObject())
+ return i.backEdge;
+ }
+ return false;
}