diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-03-06 18:48:16 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-03-06 18:48:16 (GMT) |
commit | 12b8a066d1d8dd8cbef587dc6fafed870604f49f (patch) | |
tree | 3eb6cfbab886b430a8479fda9a721f75ae806a4d /src/arch/arm/v7/post.c | |
parent | 0320d85e480882c58f254640a54c6c6e190dbf47 (diff) |
Locked access to instruction operands when needed.
Diffstat (limited to 'src/arch/arm/v7/post.c')
-rw-r--r-- | src/arch/arm/v7/post.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/arch/arm/v7/post.c b/src/arch/arm/v7/post.c index 5ac3c62..6c63832 100644 --- a/src/arch/arm/v7/post.c +++ b/src/arch/arm/v7/post.c @@ -56,11 +56,12 @@ void post_process_ldr_instructions(GArchInstruction *instr, GArchProcessor *proc GBinRoutine *routine; /* Nouvelle routine trouvée */ GBinSymbol *symbol; /* Nouveau symbole construit */ - op = g_arch_instruction_get_operand(instr, 1); + g_arch_instruction_lock_operands(instr); + op = _g_arch_instruction_get_operand(instr, 1); - if (!G_IS_IMM_OPERAND(op)) return; - + if (!G_IS_IMM_OPERAND(op)) + goto ppli_release; if (g_imm_operand_get_value(G_IMM_OPERAND(op), MDS_32_BITS_UNSIGNED, &addr) && g_exe_format_translate_address_into_vmpa(format, addr, &target)) @@ -92,8 +93,12 @@ void post_process_ldr_instructions(GArchInstruction *instr, GArchProcessor *proc } - g_arch_instruction_replace_operand(instr, new, op); + _g_arch_instruction_replace_operand(instr, new, op); } + ppli_release: + + g_arch_instruction_unlock_operands(instr); + } |