summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-04-20 12:07:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-04-20 12:07:19 (GMT)
commit59f319d9a6961a7424c7b32f49aa7ac1045a1d4c (patch)
treee9d62c684dd8d8f5e141b9332994041bd2371f9a /src/gui
parent8962a4e61411c8362d5f4be63496977164b886a8 (diff)
Protected all concurrent accesses to sources and destinations of instructions.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/gotox.c13
-rw-r--r--src/gui/dialogs/gotox.h2
2 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/dialogs/gotox.c b/src/gui/dialogs/gotox.c
index fd05100..5d19fee 100644
--- a/src/gui/dialogs/gotox.c
+++ b/src/gui/dialogs/gotox.c
@@ -269,7 +269,7 @@ GtkWidget *create_gotox_dialog_for_entry_points(GtkWindow *parent, GLoadedBinary
* *
******************************************************************************/
-GtkWidget *create_gotox_dialog_for_cross_references(GtkWindow *parent, GLoadedBinary *binary, const GArchInstruction *instr, bool back)
+GtkWidget *create_gotox_dialog_for_cross_references(GtkWindow *parent, GLoadedBinary *binary, GArchInstruction *instr, bool back)
{
GtkWidget *result; /* Fenêtre à renvoyer */
GtkTreeStore *store; /* Modèle de gestion */
@@ -290,9 +290,15 @@ GtkWidget *create_gotox_dialog_for_cross_references(GtkWindow *parent, GLoadedBi
/* Affichage de toutes les instructions référencées */
if (back)
+ {
+ g_arch_instruction_rlock_src(instr);
count = g_arch_instruction_get_sources(instr, &list, NULL);
+ }
else
+ {
+ g_arch_instruction_rlock_dest(instr);
count = g_arch_instruction_get_destinations(instr, &list, NULL, NULL);
+ }
for (i = 0; i < count; i++)
{
@@ -302,6 +308,11 @@ GtkWidget *create_gotox_dialog_for_cross_references(GtkWindow *parent, GLoadedBi
}
+ if (back)
+ g_arch_instruction_runlock_src(instr);
+ else
+ g_arch_instruction_runlock_dest(instr);
+
g_object_unref(G_OBJECT(store));
gtk_dialog_set_response_sensitive(GTK_DIALOG(result), GTK_RESPONSE_OK, count > 0);
diff --git a/src/gui/dialogs/gotox.h b/src/gui/dialogs/gotox.h
index ab17d42..4284ae8 100644
--- a/src/gui/dialogs/gotox.h
+++ b/src/gui/dialogs/gotox.h
@@ -37,7 +37,7 @@
GtkWidget *create_gotox_dialog_for_entry_points(GtkWindow *, GLoadedBinary *);
/* Construit la fenêtre de sélection des références croisées. */
-GtkWidget *create_gotox_dialog_for_cross_references(GtkWindow *, GLoadedBinary *, const GArchInstruction *, bool);
+GtkWidget *create_gotox_dialog_for_cross_references(GtkWindow *, GLoadedBinary *, GArchInstruction *, bool);
/* Fournit l'adresse obtenue par la saisie de l'utilisateur. */
vmpa2t *get_address_from_gotox_dialog(GtkWidget *);