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/libcsem | |
parent | acc7b5f33e93bae3bf43e8f029976b7f74260b52 (diff) |
Simplified the way links between instructions are handled.
Diffstat (limited to 'plugins/libcsem')
-rw-r--r-- | plugins/libcsem/exit.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/libcsem/exit.c b/plugins/libcsem/exit.c index 6695787..6a21d5f 100644 --- a/plugins/libcsem/exit.c +++ b/plugins/libcsem/exit.c @@ -52,9 +52,9 @@ static void mark_one_kind_of_exit_as_return(const GLoadedBinary *binary, const c const mrange_t *range; /* Emplacement du symbole */ GArchProcessor *proc; /* Architecture du binaire */ GArchInstruction *instr; /* Instruction de sortie */ - instr_link_t *sources; /* Instructions diverses liées */ size_t count; /* Nbre de sources affichées */ size_t i; /* Boucle de parcours */ + instr_link_t *source; /* Instruction diverse liée */ format = G_BIN_FORMAT(g_loaded_binary_get_format(binary)); @@ -73,18 +73,21 @@ static void mark_one_kind_of_exit_as_return(const GLoadedBinary *binary, const c if (instr == NULL) goto mokoear_not_found; - g_arch_instruction_rlock_src(instr); - count = g_arch_instruction_get_sources(instr, &sources); + g_arch_instruction_lock_src(instr); + + count = g_arch_instruction_count_sources(instr); for (i = 0; i < count; i++) { - if (sources[i].type != ILT_CALL) continue; + source = g_arch_instruction_get_source(instr, i); + + if (source->type != ILT_CALL) continue; - g_arch_instruction_set_flag(sources[i].linked, AIF_RETURN_POINT); + g_arch_instruction_set_flag(source->linked, AIF_RETURN_POINT); } - g_arch_instruction_runlock_src(instr); + g_arch_instruction_unlock_src(instr); g_object_unref(G_OBJECT(instr)); |