diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/analysis/disass/links.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/analysis/disass/links.c b/src/analysis/disass/links.c index 295b4b6..cf33677 100644 --- a/src/analysis/disass/links.c +++ b/src/analysis/disass/links.c @@ -54,11 +54,11 @@ static void convert_immediate_into_target(GArchInstruction *, size_t, GBinFormat void establish_natural_link(GArchInstruction *instr, GArchInstruction *prev) { bool has_src; /* Présence de sources ? */ - bool no_natural; /* Aucun lien naturel présent */ - bool no_need; /* Pas de besoin pour ce lien */ instr_link_t *others; /* Instructions diverses liées */ size_t count; /* Nbre de sources affichées */ size_t i; /* Boucle de parcours */ + bool no_natural; /* Aucun lien naturel présent */ + bool no_need; /* Pas de besoin pour ce lien */ /** * Si rien ne vient séparer les deux instructions, @@ -66,7 +66,15 @@ void establish_natural_link(GArchInstruction *instr, GArchInstruction *prev) */ g_arch_instruction_rlock_src(instr); - has_src = g_arch_instruction_has_sources(instr); + + count = g_arch_instruction_get_sources(instr, &others); + + has_src = false; + + for (i = 0; i < count && !has_src; i++) + if (others[i].type != ILT_REF) + has_src = true; + g_arch_instruction_runlock_src(instr); if (!has_src) @@ -88,12 +96,13 @@ void establish_natural_link(GArchInstruction *instr, GArchInstruction *prev) * déjà en place. */ - no_natural = true; - no_need = true; - g_arch_instruction_rlock_dest(prev); + count = g_arch_instruction_get_destinations(prev, &others); + no_natural = true; + no_need = (count > 0); + for (i = 0; i < count && no_natural; i++) switch (others[i].type) { |