summaryrefslogtreecommitdiff
path: root/src/format
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-10-02 22:38:13 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-10-02 22:38:13 (GMT)
commit34f0ead7c89b716c6a9f59f8dea6a9450e37e82a (patch)
treec1a41f5b11022e761becdb127d9180e46a58ede6 /src/format
parent537ed969ad0305e70dc2d503dbc49df859892717 (diff)
Given more flexibility to qinsert() for the inserted item.
Diffstat (limited to 'src/format')
-rw-r--r--src/format/format.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/format/format.c b/src/format/format.c
index 5e5755c..be3627e 100644
--- a/src/format/format.c
+++ b/src/format/format.c
@@ -294,6 +294,7 @@ void g_binary_format_add_symbol(GBinFormat *format, GBinSymbol *symbol)
const mrange_t *range; /* Couverture du symbole */
const vmpa2t *addr; /* Emplacement du symbole */
#endif
+ GBinRoutine *routine; /* Nouvelle routine à insérer */
/**
* Lorsque les fonctions de recherche type g_binary_format_find_symbol_at()
@@ -316,16 +317,18 @@ void g_binary_format_add_symbol(GBinFormat *format, GBinSymbol *symbol)
g_rw_lock_writer_lock(&format->syms_lock);
format->symbols = qinsert(format->symbols, &format->symbols_count,
- sizeof(GBinSymbol *), (__compar_fn_t)g_binary_symbol_cmp, symbol);
+ sizeof(GBinSymbol *), (__compar_fn_t)g_binary_symbol_cmp, &symbol);
switch (g_binary_symbol_get_target_type(symbol))
{
case STP_ROUTINE:
case STP_ENTRY_POINT:
+ routine = g_binary_symbol_get_routine(symbol);
+
format->routines = qinsert(format->routines, &format->routines_count,
sizeof(GBinRoutine *), (__compar_fn_t)g_binary_routine_compare,
- g_binary_symbol_get_routine(symbol));
+ &routine);
break;
default: