summaryrefslogtreecommitdiff
path: root/src/analysis/disass
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/loop.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/analysis/disass/loop.c b/src/analysis/disass/loop.c
index 9e964e5..b82d58e 100644
--- a/src/analysis/disass/loop.c
+++ b/src/analysis/disass/loop.c
@@ -408,7 +408,15 @@ static void define_basic_blocks_loops(GBlockList *list, bblock_info_t *info)
links = get_block_successors(block, info, &count);
for (k = 0; k < count; k++)
- if (links[k].info == iter->iloop_header)
+ if (links[k].info == iter->iloop_header
+ /**
+ * Il se peut qu'un bloc fasse référence à lui même !
+ *
+ * Cf. tests/analysis/disass/selfloop.c
+ *
+ * On évite ici une boucle sans fin en officialisant cette boucle.
+ */
+ || links[k].info == iter)
{
g_basic_block_get_boundaries(G_BASIC_BLOCK(block), NULL, &last);
g_basic_block_get_boundaries(G_BASIC_BLOCK(links[k].linked), &first, NULL);