summaryrefslogtreecommitdiff
path: root/plugins/libcsem
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-08-03 11:24:26 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-08-03 11:24:26 (GMT)
commit4d179bc994cf85832d08f468c7e4122ad23e9244 (patch)
tree3348d3c001c961e9e464a644c12c9fc85e78d9b5 /plugins/libcsem
parent77735c8c77497498e3beb4f5bcec7de3b592fcbd (diff)
Updated the reference counters when providing instruction links.
Diffstat (limited to 'plugins/libcsem')
-rw-r--r--plugins/libcsem/exit.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/libcsem/exit.c b/plugins/libcsem/exit.c
index ee536b5..794369e 100644
--- a/plugins/libcsem/exit.c
+++ b/plugins/libcsem/exit.c
@@ -54,7 +54,7 @@ static void mark_one_kind_of_exit_as_return(const GLoadedBinary *binary, const c
GArchInstruction *instr; /* Instruction de sortie */
size_t count; /* Nbre de sources affichées */
size_t i; /* Boucle de parcours */
- instr_link_t *source; /* Instruction diverse liée */
+ const instr_link_t *source; /* Instruction diverse liée */
format = G_BIN_FORMAT(g_loaded_binary_get_format(binary));
@@ -81,9 +81,10 @@ static void mark_one_kind_of_exit_as_return(const GLoadedBinary *binary, const c
{
source = g_arch_instruction_get_source(instr, i);
- if (source->type != ILT_CALL) continue;
+ if (source->type == ILT_CALL)
+ g_arch_instruction_set_flag(source->linked, AIF_RETURN_POINT);
- g_arch_instruction_set_flag(source->linked, AIF_RETURN_POINT);
+ unref_instr_link(source);
}