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 /plugins/stackvars | |
parent | 0320d85e480882c58f254640a54c6c6e190dbf47 (diff) |
Locked access to instruction operands when needed.
Diffstat (limited to 'plugins/stackvars')
-rw-r--r-- | plugins/stackvars/stackvars.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/stackvars/stackvars.c b/plugins/stackvars/stackvars.c index c2b4777..f3baeef 100644 --- a/plugins/stackvars/stackvars.c +++ b/plugins/stackvars/stackvars.c @@ -205,16 +205,18 @@ static bool replace_stack_vars_in_instruction(GArchInstruction *instr, GBinRouti result = false; new = NULL; /* Pour GCC */ - opcount = g_arch_instruction_count_operands(instr); + g_arch_instruction_lock_operands(instr); + + opcount = _g_arch_instruction_count_operands(instr); for (i = 0; i < opcount; i++) { - operand = g_arch_instruction_get_operand(instr, i); + operand = _g_arch_instruction_get_operand(instr, i); result = replace_stack_var_in_operand(operand, routine, dryrun, &new); if (!dryrun && result) { - g_arch_instruction_replace_operand(instr, new, operand); + _g_arch_instruction_replace_operand(instr, new, operand); result = true; @@ -222,6 +224,8 @@ static bool replace_stack_vars_in_instruction(GArchInstruction *instr, GBinRouti } + g_arch_instruction_unlock_operands(instr); + return result; } |