diff options
Diffstat (limited to 'src/analysis/disass')
-rw-r--r-- | src/analysis/disass/area.c | 6 | ||||
-rw-r--r-- | src/analysis/disass/block.c | 12 | ||||
-rw-r--r-- | src/analysis/disass/links.c | 1 |
3 files changed, 10 insertions, 9 deletions
diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c index 84bf8a4..f1aa002 100644 --- a/src/analysis/disass/area.c +++ b/src/analysis/disass/area.c @@ -348,8 +348,7 @@ static void fini_mem_area(mem_area *area) len = get_mrange_length(&area->range); for (i = 0; i < len; i++) - if (area->instructions[i] != NULL) - g_object_unref(G_OBJECT(area->instructions[i])); + g_clear_object(&area->instructions[i]); free(area->instructions); @@ -681,7 +680,10 @@ static void update_address_as_routine(GBinFormat *format, const vmpa2t *addr) if (!found || (found && wrong_type)) { if (found) + { g_binary_format_remove_symbol(format, symbol); + g_object_unref(G_OBJECT(symbol)); + } init_mrange(&range, addr, 0); diff --git a/src/analysis/disass/block.c b/src/analysis/disass/block.c index 021284e..9fce202 100644 --- a/src/analysis/disass/block.c +++ b/src/analysis/disass/block.c @@ -41,6 +41,7 @@ struct _GBasicBlock { GCodeBlock parent; /* A laisser en premier */ + /* Référence circulaire */ GLoadedBinary *binary; /* Binaire chargé et associé */ GArchInstruction *first; /* Première instruction */ @@ -159,10 +160,8 @@ static void g_basic_block_init(GBasicBlock *block) static void g_basic_block_dispose(GBasicBlock *block) { - g_clear_object(&block->binary); - - g_clear_object(&block->first); - g_clear_object(&block->last); + //g_clear_object(&block->first); + //g_clear_object(&block->last); G_OBJECT_CLASS(g_basic_block_parent_class)->dispose(G_OBJECT(block)); @@ -211,13 +210,12 @@ GCodeBlock *g_basic_block_new(GLoadedBinary *binary, GArchInstruction *first, GA result = g_object_new(G_TYPE_BASIC_BLOCK, NULL); result->binary = binary; - g_object_ref(G_OBJECT(binary)); result->first = first; result->last = last; - g_object_ref(G_OBJECT(first)); - g_object_ref(G_OBJECT(last)); + //g_object_ref(G_OBJECT(first)); + //g_object_ref(G_OBJECT(last)); parent = G_CODE_BLOCK(result); diff --git a/src/analysis/disass/links.c b/src/analysis/disass/links.c index 381aedc..26788db 100644 --- a/src/analysis/disass/links.c +++ b/src/analysis/disass/links.c @@ -128,6 +128,7 @@ void establish_natural_link(GArchInstruction *instr, GArchInstruction *prev) else { no_need = true; + unref_instr_link(other); goto check_done; } break; |