summaryrefslogtreecommitdiff
path: root/src/gui/menus
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/menus')
-rw-r--r--src/gui/menus/edition.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c
index 95b4f50..da2c60f 100644
--- a/src/gui/menus/edition.c
+++ b/src/gui/menus/edition.c
@@ -384,6 +384,8 @@ static void mcb_edition_switch_numeric_operand(GtkMenuItem *menuitem, GMenuBar *
switcher = g_db_switcher_new(instr, G_IMM_OPERAND(creator), display);
+ g_object_unref(G_OBJECT(instr));
+
g_loaded_binary_add_to_collection(binary, G_DB_ITEM(switcher));
g_object_unref(G_OBJECT(proc));
@@ -492,7 +494,6 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar)
const mrange_t *range; /* Couverture en mémoire */
GLoadedBinary *binary; /* Représentation binaire */
GArchProcessor *proc; /* Processeur de l'architecture*/
- GArchInstruction *list; /* Ensemble des instructions */
GArchInstruction *instr; /* Point de croisements */
GObject *ref; /* Espace de référencements */
GtkWidget *dialog; /* Boîte de dialogue à montrer */
@@ -506,7 +507,6 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar)
binary = g_editor_item_get_current_binary(G_EDITOR_ITEM(bar));
proc = g_loaded_binary_get_processor(binary);
- list = g_arch_processor_get_disassembled_instructions(proc);
/**
* On ne peut pas se reposer sur l'espace couvert par une ligne, car il peut
@@ -518,9 +518,9 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar)
*
* instr = g_arch_instruction_find_by_range(list, range);
*
- * Il faut ainsi être plus souple.
+ * Il faut ainsi être plus souple, et se baser sur l'adresse uniquement.
*/
- instr = g_arch_instruction_find_by_address(list, get_mrange_addr(range), true);
+ instr = g_arch_processor_find_instr_by_address(proc, get_mrange_addr(range));
ref = g_editor_item_get_global_ref(G_EDITOR_ITEM(bar));
@@ -538,6 +538,9 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar)
gtk_widget_destroy(dialog);
+ if (instr != NULL)
+ g_object_unref(G_OBJECT(instr));
+
g_object_unref(G_OBJECT(proc));
g_object_unref(G_OBJECT(line));