summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/analysis/disass/rank.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9024665..5b4444d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
16-10-03 Cyrille Bagard <nocbos@gmail.com>
+ * src/analysis/disass/rank.c:
+ Compute block ranks without mistake.
+
+16-10-03 Cyrille Bagard <nocbos@gmail.com>
+
* src/common/sort.c:
Give more flexibility to qinsert() for the inserted item.
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);