diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-04-13 16:34:34 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-04-13 16:34:34 (GMT) |
commit | 6906aa19b7ac4c14615c30d15bfb26b0b86557d5 (patch) | |
tree | f0fb0b6ea116e4ec87f33b3b4198f6dc4c88766c /plugins/androhelpers | |
parent | acc7b5f33e93bae3bf43e8f029976b7f74260b52 (diff) |
Simplified the way links between instructions are handled.
Diffstat (limited to 'plugins/androhelpers')
-rw-r--r-- | plugins/androhelpers/switch.c | 2 | ||||
-rw-r--r-- | plugins/androhelpers/try_n_catch.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/plugins/androhelpers/switch.c b/plugins/androhelpers/switch.c index 275a6e7..20e6037 100644 --- a/plugins/androhelpers/switch.c +++ b/plugins/androhelpers/switch.c @@ -219,7 +219,7 @@ static void ensure_each_case_has_its_block(GArchInstruction *instr, GArchInstruc prev = g_arch_instruction_get_prev_iter(instrs, instr); if (prev != NULL - && !g_arch_instruction_has_destinations(prev) + && g_arch_instruction_count_destinations(prev) == 0 && !(g_arch_instruction_get_flags(prev) & AIF_RETURN_POINT)) { g_arch_instruction_link_with(prev, instr, ILT_EXEC_FLOW); diff --git a/plugins/androhelpers/try_n_catch.c b/plugins/androhelpers/try_n_catch.c index 9052377..5dff71e 100644 --- a/plugins/androhelpers/try_n_catch.c +++ b/plugins/androhelpers/try_n_catch.c @@ -135,13 +135,13 @@ static void attach_caught_code(const GLoadedBinary *binary, const GBinRoutine *r /* Si des détachements sont nécessaires... */ - if (!g_arch_instruction_has_sources(first) && try->start_addr > 0) + if (g_arch_instruction_count_sources(first) == 0 && try->start_addr > 0) { prev = g_arch_instruction_get_prev_iter(instrs, first); g_arch_instruction_link_with(prev, first, ILT_EXEC_FLOW); } - if (!g_arch_instruction_has_sources(next) && (try->start_addr > 0 || try->insn_count > 0)) + if (g_arch_instruction_count_sources(next) == 0 && (try->start_addr > 0 || try->insn_count > 0)) { prev = g_arch_instruction_get_prev_iter(instrs, next); g_arch_instruction_link_with(prev, next, ILT_EXEC_FLOW); @@ -155,7 +155,7 @@ static void attach_caught_code(const GLoadedBinary *binary, const GBinRoutine *r iter != NULL; iter = g_arch_instruction_get_next_iter(instrs, iter, end)) { - if (!g_arch_instruction_has_destinations(iter)) + if (g_arch_instruction_count_destinations(iter) == 0) continue; for (i = 0; i < count; i++) |