summaryrefslogtreecommitdiff
path: root/plugins/stackvars/stackvars.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/stackvars/stackvars.c')
-rw-r--r--plugins/stackvars/stackvars.c10
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;
}