summaryrefslogtreecommitdiff
path: root/src/arch/arm/v7/fetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/arm/v7/fetch.c')
-rw-r--r--src/arch/arm/v7/fetch.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/arch/arm/v7/fetch.c b/src/arch/arm/v7/fetch.c
index 15707e3..6675706 100644
--- a/src/arch/arm/v7/fetch.c
+++ b/src/arch/arm/v7/fetch.c
@@ -388,13 +388,16 @@ void help_fetching_with_instruction_ldr_literal_with_orig(GArchInstruction *inst
break;
}
- op = g_arch_instruction_get_operand(instr, 1);
+ g_arch_instruction_lock_operands(instr);
+
+ op = _g_arch_instruction_get_operand(instr, 1);
assert(G_IS_IMM_OPERAND(op));
ret = g_imm_operand_get_value(G_IMM_OPERAND(op), MDS_32_BITS_UNSIGNED, &offset);
if (!ret)
{
assert(0);
+ g_arch_instruction_unlock_operands(instr);
return;
}
@@ -405,6 +408,7 @@ void help_fetching_with_instruction_ldr_literal_with_orig(GArchInstruction *inst
if (!g_exe_format_translate_offset_into_vmpa(format, val_offset, &sym_addr))
{
assert(0);
+ g_arch_instruction_unlock_operands(instr);
return;
}
@@ -427,7 +431,11 @@ void help_fetching_with_instruction_ldr_literal_with_orig(GArchInstruction *inst
ret = g_binary_content_read_u32(content, &pos, SRE_LITTLE /* FIXME */, &target);
g_object_unref(G_OBJECT(content));
- if (!ret) return;
+ if (!ret)
+ {
+ g_arch_instruction_unlock_operands(instr);
+ return;
+ }
/* Réalise l'intégration du symbole associé */
@@ -480,8 +488,9 @@ void help_fetching_with_instruction_ldr_literal_with_orig(GArchInstruction *inst
new = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, target);
- g_arch_instruction_replace_operand(instr, new, op);
+ _g_arch_instruction_replace_operand(instr, new, op);
+ g_arch_instruction_unlock_operands(instr);