diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-08-16 22:26:41 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-08-16 22:26:41 (GMT) |
commit | d3f9ef68a9939ee43e8a70748dd4b7e97352179e (patch) | |
tree | 08f6d5cd4bddbd42448a0a4efe0522c0a96c99a2 /plugins/fmtp | |
parent | ed763539951307353042c04af5c2278db0d05298 (diff) |
Kept only the first submission when preloading instructions.
Diffstat (limited to 'plugins/fmtp')
-rw-r--r-- | plugins/fmtp/parser.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/fmtp/parser.c b/plugins/fmtp/parser.c index 96aeb11..fe41e9b 100644 --- a/plugins/fmtp/parser.c +++ b/plugins/fmtp/parser.c @@ -55,10 +55,10 @@ static bool parse_field_definition(const fmt_field_def *, GBinFormat *, GPreload static bool parse_field_definition(const fmt_field_def *def, GBinFormat *format, GPreloadInfo *info, vmpa2t *pos, void *data) { + bool result; /* Bilan à retourner */ GBinContent *content; /* Contenu binaire à lire */ SourceEndian endian; /* Boutisme utilisé */ vmpa2t mod; /* Position modifiable */ - bool result; /* Bilan à retourner */ GArchInstruction *instr; /* Instruction décodée */ GImmOperand *imm; /* Opérande à transformer */ size_t i; /* Boucle de parcours */ @@ -66,6 +66,7 @@ static bool parse_field_definition(const fmt_field_def *def, GBinFormat *format, GDbComment *comment; /* Définition de commentaire */ uint64_t raw; /* Valeur brute à étudier */ const comment_part *part; /* Accès plus direct */ + bool inserted; /* Bilan d'une insertion */ /* Lecture */ @@ -192,9 +193,13 @@ static bool parse_field_definition(const fmt_field_def *def, GBinFormat *format, /* Insertions */ - g_preload_info_add_instruction(info, instr); + inserted = g_preload_info_add_instruction(info, instr); - g_preload_info_add_comment(info, comment); + if (inserted) + g_preload_info_add_comment(info, comment); + + else + g_object_unref(G_OBJECT(comment)); pfd_exit: |