summaryrefslogtreecommitdiff
path: root/src/arch/link.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-11-26 20:39:28 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-11-26 20:39:28 (GMT)
commit1252efcd18a845a7c2641354838c26ece3d6d873 (patch)
tree13d248454e99b76dd4c61fbd41c8c138ebb61eb7 /src/arch/link.c
parent84efc00d07f9574c3867f96a3a7333b0f9d154e6 (diff)
Increased the reference counter for provided operands and updated code.
Diffstat (limited to 'src/arch/link.c')
-rw-r--r--src/arch/link.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/arch/link.c b/src/arch/link.c
index fbcd391..2e8e455 100644
--- a/src/arch/link.c
+++ b/src/arch/link.c
@@ -61,9 +61,7 @@ void handle_jump_as_link(GArchInstruction *instr, GArchProcessor *proc, GProcCon
g_arch_instruction_unlock_operands(instr);
- if (!G_IS_IMM_OPERAND(op)) return;
-
- if (g_imm_operand_to_virt_t(G_IMM_OPERAND(op), &virt))
+ if (G_IS_IMM_OPERAND(op) && g_imm_operand_to_virt_t(G_IMM_OPERAND(op), &virt))
{
init_vmpa(&addr, VMPA_NO_PHYSICAL, virt);
@@ -77,6 +75,8 @@ void handle_jump_as_link(GArchInstruction *instr, GArchProcessor *proc, GProcCon
}
+ g_object_unref(G_OBJECT(op));
+
}
@@ -131,6 +131,8 @@ void handle_branch_as_link(GArchInstruction *instr, GArchProcessor *proc, GProcC
}
}
+ g_object_unref(G_OBJECT(op));
+
if (defined)
{
target = g_arch_processor_find_instr_by_address(proc, &addr);
@@ -191,9 +193,7 @@ void handle_call_as_link(GArchInstruction *instr, GArchProcessor *proc, GProcCon
g_arch_instruction_unlock_operands(instr);
- if (!G_IS_IMM_OPERAND(op)) return;
-
- if (g_imm_operand_to_virt_t(G_IMM_OPERAND(op), &virt))
+ if (G_IS_IMM_OPERAND(op) && g_imm_operand_to_virt_t(G_IMM_OPERAND(op), &virt))
{
init_vmpa(&addr, VMPA_NO_PHYSICAL, virt);
@@ -207,4 +207,6 @@ void handle_call_as_link(GArchInstruction *instr, GArchProcessor *proc, GProcCon
}
+ g_object_unref(G_OBJECT(op));
+
}