diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-01-14 07:43:32 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-01-14 07:43:32 (GMT) |
commit | a4fde950b940582a0e21a84c6c98a79f945fde02 (patch) | |
tree | 811f96acedac6812e01bb556773d52ac55312455 /src/analysis | |
parent | 20289d6a5d60d1bcf979ff7fdfc236486848d149 (diff) |
Detected self loops in basic blocks.
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/disass/loop.c | 10 |
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); |