diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-10-02 22:40:21 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-10-02 22:40:21 (GMT) |
commit | b6427496bde6f3ab34dc62d6b437c4f8a3a29b2d (patch) | |
tree | f23acec4b6b480e1dabb0af1b54325a2e6fc9383 | |
parent | 34f0ead7c89b716c6a9f59f8dea6a9450e37e82a (diff) |
Computed block ranks without mistake.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/analysis/disass/rank.c | 5 |
2 files changed, 8 insertions, 2 deletions
@@ -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); |