summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-03-21 21:18:53 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-03-23 07:18:48 (GMT)
commit518ce6e1594ba80be4286bd3e561b0b7f73ce4b0 (patch)
treea7591a6cdeb5d289861a23da75bb07ddf0c5ac90 /src/analysis
parent222c14bbc67f8b15a41f3890ee11eff289c083bb (diff)
Restricted an instruction iterator to a given memory range if requested.
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/disass/dragon.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/analysis/disass/dragon.c b/src/analysis/disass/dragon.c
index 80329dc..b4c85c0 100644
--- a/src/analysis/disass/dragon.c
+++ b/src/analysis/disass/dragon.c
@@ -101,7 +101,6 @@ static dragon_node *create_dragon_nodes(GArchProcessor *proc, const instr_covera
GArchInstruction *last; /* Mémorisation du passé */
instr_iter_t *iter; /* Boucle de parcours */
GArchInstruction *instr; /* Instruction analysée */
- const mrange_t *irange; /* Emplacement d'instruction */
instr_link_t *sources; /* Liste des instructions liées*/
size_t scount; /* Nombre de liens de source */
bool cut; /* Un découpage a été réalisé ?*/
@@ -119,20 +118,12 @@ static dragon_node *create_dragon_nodes(GArchProcessor *proc, const instr_covera
iter = g_arch_processor_get_covered_iter_from_address(proc, coverage, start);
if (iter == NULL) goto cdn_no_coverage;
+ restrict_instruction_iterator(iter, range);
+
for (last = NULL, instr = get_instruction_iterator_current(iter);
instr != NULL;
last = instr, instr = get_instruction_iterator_next(iter))
{
- /* L'instruction sort-elle des clous ? */
-
- irange = g_arch_instruction_get_range(instr);
-
- if (!mrange_contains_mrange(range, irange))
- {
- g_object_unref(G_OBJECT(instr));
- break;
- }
-
/* Découpage en blocs */
if (need_alloc)