diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/analysis/disass/links.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/analysis/disass/links.c b/src/analysis/disass/links.c index 26788db..4eba0d7 100644 --- a/src/analysis/disass/links.c +++ b/src/analysis/disass/links.c @@ -58,8 +58,7 @@ void establish_natural_link(GArchInstruction *instr, GArchInstruction *prev) bool has_src; /* Présence de sources ? */ const instr_link_t *other; /* Instruction diverse liée */ size_t i; /* Boucle de parcours */ - bool no_natural; /* Aucun lien naturel présent */ - bool no_need; /* Pas de besoin pour ce lien */ + bool need; /* Besoin exprimé pour ce lien */ /** * Si rien ne vient séparer les deux instructions, @@ -108,29 +107,26 @@ void establish_natural_link(GArchInstruction *instr, GArchInstruction *prev) count = g_arch_instruction_count_destinations(prev); - no_natural = true; - no_need = (count > 0); + need = true; - for (i = 0; i < count && no_natural; i++) + for (i = 0; i < count && need; i++) { other = g_arch_instruction_get_destination(prev, i); switch (other->type) { case ILT_EXEC_FLOW: - no_natural = false; + need = false; + break; + + case ILT_JUMP: + case ILT_CASE_JUMP: + need = false; break; case ILT_JUMP_IF_TRUE: case ILT_JUMP_IF_FALSE: - if (other->linked != instr) - no_need = false; - else - { - no_need = true; - unref_instr_link(other); - goto check_done; - } + need = (other->linked != instr); break; default: @@ -142,11 +138,9 @@ void establish_natural_link(GArchInstruction *instr, GArchInstruction *prev) } - check_done: - g_arch_instruction_unlock_dest(prev); - if (no_natural && !no_need) + if (need) { /* Vérification de la cohérence de l'ensemble */ #ifndef NDEBUG |