summaryrefslogtreecommitdiff
path: root/src/arch/link.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/link.c')
-rw-r--r--src/arch/link.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/arch/link.c b/src/arch/link.c
index dfc2bd5..fbcd391 100644
--- a/src/arch/link.c
+++ b/src/arch/link.c
@@ -53,9 +53,13 @@ void handle_jump_as_link(GArchInstruction *instr, GArchProcessor *proc, GProcCon
vmpa2t addr; /* Adresse de destination */
GArchInstruction *target; /* Ligne visée par la référence*/
- assert(g_arch_instruction_count_operands(instr) > 0);
+ g_arch_instruction_lock_operands(instr);
- op = g_arch_instruction_get_operand(instr, 0);
+ assert(_g_arch_instruction_count_operands(instr) > 0);
+
+ op = _g_arch_instruction_get_operand(instr, 0);
+
+ g_arch_instruction_unlock_operands(instr);
if (!G_IS_IMM_OPERAND(op)) return;
@@ -102,9 +106,13 @@ void handle_branch_as_link(GArchInstruction *instr, GArchProcessor *proc, GProcC
const mrange_t *range; /* Emplacement d'instruction */
vmpa2t next; /* Position suivante */
- assert(g_arch_instruction_count_operands(instr) > index);
+ g_arch_instruction_lock_operands(instr);
+
+ assert(_g_arch_instruction_count_operands(instr) > index);
- op = g_arch_instruction_get_operand(instr, index);
+ op = _g_arch_instruction_get_operand(instr, index);
+
+ g_arch_instruction_unlock_operands(instr);
defined = false;
@@ -175,9 +183,13 @@ void handle_call_as_link(GArchInstruction *instr, GArchProcessor *proc, GProcCon
vmpa2t addr; /* Adresse de destination */
GArchInstruction *target; /* Ligne visée par la référence*/
- assert(g_arch_instruction_count_operands(instr) > 0);
+ g_arch_instruction_lock_operands(instr);
+
+ assert(_g_arch_instruction_count_operands(instr) > 0);
+
+ op = _g_arch_instruction_get_operand(instr, 0);
- op = g_arch_instruction_get_operand(instr, 0);
+ g_arch_instruction_unlock_operands(instr);
if (!G_IS_IMM_OPERAND(op)) return;