Skip to content

Commit

Permalink
fix flat graph after rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
  • Loading branch information
nirizr committed Jun 19, 2017
1 parent b135b38 commit 28e8995
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class FlatGraphVector(Vector):

def __init__(self, *args, **kwargs):
super(FlatGraphVector, self).__init__(*args, **kwargs)
self.flow_chart = idaapi.FlowChart(idaapi.get_func(self.offset))
self.flow_chart = None
self.visited = set()
self.items = list[self.flow_chart.size]
self.items = list()

def _bb_size(self, bb):
if bb.endEA > bb.startEA:
Expand All @@ -22,7 +22,7 @@ def _bb_size(self, bb):

def _bb_value(self, bb):
# TODO: this should be something that's uncorellated with the order of
# basic blocks
# basic blocks and describes basic blocks well
return self._bb_size(bb)

def _append_bbs(self, *bbs):
Expand Down Expand Up @@ -54,7 +54,9 @@ def _recurse_bb(self, bb):
for sibling in siblings:
self._recurse_siblings(sibling)

def _data(self):
def data(self, offset):
self.flow_chart = idaapi.FlowChart(idaapi.get_func(offset))
self.items.append(self.flow_chart.size)
head = self._find_head()
self._recurse_bb(head)
return self.items

0 comments on commit 28e8995

Please sign in to comment.