summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-12-21 16:35:08 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-12-21 16:35:08 (GMT)
commit365246bd2d9dd9f7eea008b25b8550bba0aac1cc (patch)
tree32c748733c0c78f2639550e573050c42b9708bb0 /src
parent601d8f44d523a1f687393339f5767589ec84b682 (diff)
Fixed a bug in the dominators computation.
Diffstat (limited to 'src')
-rw-r--r--src/analysis/disass/dragon.c10
-rw-r--r--src/analysis/disass/loop.c13
2 files changed, 1 insertions, 22 deletions
diff --git a/src/analysis/disass/dragon.c b/src/analysis/disass/dragon.c
index 7040b3b..eb91ad1 100644
--- a/src/analysis/disass/dragon.c
+++ b/src/analysis/disass/dragon.c
@@ -576,14 +576,6 @@ void compute_all_dominators(dragon_node *nodes, size_t count)
predecessor = find_node_for_instruction(nodes, count, true, source->linked);
- /*
- printf(" -- finding pred @ 0x%08x -> 0x%08x :: %p\n",
- (unsigned int)g_arch_instruction_get_range(node->first)->addr.virtual,
- (unsigned int)g_arch_instruction_get_range(srcs[i])->addr.virtual,
- predecessor);
- */
-
-
if (predecessor != NULL)
and_bit_field(inter, predecessor->bits);
@@ -602,8 +594,6 @@ void compute_all_dominators(dragon_node *nodes, size_t count)
set_in_bit_field(inter, k, 1);
- or_bit_field(inter, node->bits);
-
if (compare_bit_fields(node->bits, inter) != 0)
{
copy_bit_field(node->bits, inter);
diff --git a/src/analysis/disass/loop.c b/src/analysis/disass/loop.c
index 40ce441..b41e6b2 100644
--- a/src/analysis/disass/loop.c
+++ b/src/analysis/disass/loop.c
@@ -84,18 +84,7 @@ static void detect_back_edges(dragon_node *nodes, size_t count)
id = get_dragon_node_index(nodes, target);
if (test_in_bit_field(dominators, id))
- {
-
- /*
- printf("BACKEDGE :: 0x%08lx -> 0x%08lx\n",
- (unsigned int)g_arch_instruction_get_range(last)->addr.virtual,
- (unsigned int)g_arch_instruction_get_range(dests[i])->addr.virtual);
- */
-
- /* status = */g_arch_instruction_change_link(last, dest->linked, dest->type, ILT_LOOP);
-
-
- }
+ g_arch_instruction_change_link(last, dest->linked, dest->type, ILT_LOOP);
break;