summaryrefslogtreecommitdiff
path: root/src/analysis/disass
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-10-02 22:40:21 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-10-02 22:40:21 (GMT)
commitb6427496bde6f3ab34dc62d6b437c4f8a3a29b2d (patch)
treef23acec4b6b480e1dabb0af1b54325a2e6fc9383 /src/analysis/disass
parent34f0ead7c89b716c6a9f59f8dea6a9450e37e82a (diff)
Computed block ranks without mistake.
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/rank.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/analysis/disass/rank.c b/src/analysis/disass/rank.c
index 3694d04..0b9068b 100644
--- a/src/analysis/disass/rank.c
+++ b/src/analysis/disass/rank.c
@@ -341,9 +341,9 @@ void rank_routine_block(const GBlockList *list, GBasicBlock *block)
{
rank = g_basic_block_get_rank(target);
- if (next > rank)
+ if (next > rank || rank == -1)
{
- g_basic_block_set_rank(target, rank);
+ g_basic_block_set_rank(target, next);
rank_routine_block(list, target);
@@ -381,6 +381,7 @@ void rank_routine_blocks(GBinRoutine *routine)
assert(start != NULL);
+ g_basic_block_set_rank(start, 0);
rank_routine_block(blocks, start);