summaryrefslogtreecommitdiff
path: root/python/basicblock.py
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 /python/basicblock.py
parentc51f3bed6bdef577253feee0e85a71fda1931bd7 (diff)
parentd3a401da5af8dd471adf842b63c7368c7f8e87d0 (diff)
Merging dev to master for linux demo fix -- will not change personal or
commercial builds
Diffstat (limited to 'python/basicblock.py')
-rw-r--r--python/basicblock.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/python/basicblock.py b/python/basicblock.py
index 3dc5b050..7858cc60 100644
--- a/python/basicblock.py
+++ b/python/basicblock.py
@@ -29,10 +29,11 @@ import function
class BasicBlockEdge(object):
- def __init__(self, branch_type, source, target):
+ def __init__(self, branch_type, source, target, back_edge):
self.type = branch_type
self.source = source
self.target = target
+ self.back_edge = back_edge
def __repr__(self):
if self.type == BranchType.UnresolvedBranch:
@@ -42,11 +43,6 @@ class BasicBlockEdge(object):
else:
return "<%s: %#x>" % (BranchType(self.type).name, self.target.start)
- @property
- def back_edge(self):
- """Whether the edge is a back edge (end of a loop)"""
- return self.target in self.source.dominators
-
class BasicBlock(object):
def __init__(self, view, handle):
@@ -114,7 +110,7 @@ class BasicBlock(object):
target = BasicBlock(self.view, core.BNNewBasicBlockReference(edges[i].target))
else:
target = None
- result.append(BasicBlockEdge(branch_type, self, target))
+ result.append(BasicBlockEdge(branch_type, self, target, edges[i].backEdge))
core.BNFreeBasicBlockEdgeList(edges, count.value)
return result
@@ -130,7 +126,7 @@ class BasicBlock(object):
target = BasicBlock(self.view, core.BNNewBasicBlockReference(edges[i].target))
else:
target = None
- result.append(BasicBlockEdge(branch_type, self, target))
+ result.append(BasicBlockEdge(branch_type, self, target, edges[i].backEdge))
core.BNFreeBasicBlockEdgeList(edges, count.value)
return result