summaryrefslogtreecommitdiff
path: root/src/gui/menus
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/menus')
-rw-r--r--src/gui/menus/edition.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c
index 9c01a6b..31fbc0d 100644
--- a/src/gui/menus/edition.c
+++ b/src/gui/menus/edition.c
@@ -434,8 +434,9 @@ static void mcb_edition_follow_ref(GtkMenuItem *menuitem, GMenuBar *bar)
GtkDisplayPanel *panel; /* Afficheur effectif de code */
GBufferLine *line; /* Ligne de position courante */
GObject *creator; /* Créateur à l'orgine du seg. */
- virt_t virt; /* Adresse virtuelle */
+ bool defined; /* Adresse définie ? */
vmpa2t addr; /* Adresse de destination */
+ virt_t virt; /* Adresse virtuelle */
panel = g_editor_item_get_current_view(G_EDITOR_ITEM(bar));
@@ -443,27 +444,25 @@ static void mcb_edition_follow_ref(GtkMenuItem *menuitem, GMenuBar *bar)
{
assert(creator != NULL);
- /**
- * On fait le pari de reposer uniquement sur des adresses virtuelles !
- * A changer dans un futur ?
- */
-
- virt = VMPA_NO_VIRTUAL;
+ defined = false;
if (G_IS_TARGET_OPERAND(creator))
- virt = g_target_operand_get_addr(G_TARGET_OPERAND(creator));
+ {
+ g_target_operand_get_addr(G_TARGET_OPERAND(creator), &addr);
+ defined = true;
+ }
else if (G_IS_IMM_OPERAND(creator))
{
- if (!g_imm_operand_to_virt_t(G_IMM_OPERAND(creator), &virt))
- virt = VMPA_NO_VIRTUAL;
+ if (g_imm_operand_to_virt_t(G_IMM_OPERAND(creator), &virt))
+ {
+ init_vmpa(&addr, VMPA_NO_PHYSICAL, virt);
+ defined = true;
+ }
}
- if (virt != VMPA_NO_VIRTUAL)
- {
- init_vmpa(&addr, VMPA_NO_PHYSICAL, virt);
+ if (defined)
gtk_display_panel_request_move(panel, &addr);
- }
g_object_unref(creator);
g_object_unref(G_OBJECT(line));