summaryrefslogtreecommitdiff
path: root/src/arch/dalvik/link.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/dalvik/link.c')
-rw-r--r--src/arch/dalvik/link.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/arch/dalvik/link.c b/src/arch/dalvik/link.c
index 3295c76..f92541b 100644
--- a/src/arch/dalvik/link.c
+++ b/src/arch/dalvik/link.c
@@ -80,8 +80,9 @@ typedef struct _case_comment
void handle_dalvik_packed_switch_links(GArchInstruction *instr, GArchProcessor *proc, GProcContext *context, GExeFormat *format)
{
GArchOperand *op; /* Opérande numérique en place */
- virt_t virt; /* Adresse virtuelle */
+ bool defined; /* Adresse définie ? */
vmpa2t addr; /* Adresse de destination */
+ virt_t virt; /* Adresse virtuelle */
GArchInstruction *switch_ins; /* Instruction de branchements */
const mrange_t *range; /* Zone d'occupation */
const vmpa2t *start_addr; /* Adresse de référentiel */
@@ -104,24 +105,25 @@ void handle_dalvik_packed_switch_links(GArchInstruction *instr, GArchProcessor *
op = g_arch_instruction_get_operand(instr, 1);
- virt = VMPA_NO_VIRTUAL;
+ defined = false;
if (G_IS_TARGET_OPERAND(op))
- virt = g_target_operand_get_addr(G_TARGET_OPERAND(op));
+ {
+ g_target_operand_get_addr(G_TARGET_OPERAND(op), &addr);
+ defined = true;
+ }
else if (G_IS_IMM_OPERAND(op))
{
- if (!g_imm_operand_to_virt_t(G_IMM_OPERAND(op), &virt))
- virt = VMPA_NO_VIRTUAL;
+ if (g_imm_operand_to_virt_t(G_IMM_OPERAND(op), &virt))
+ {
+ init_vmpa(&addr, VMPA_NO_PHYSICAL, virt);
+ defined = true;
+ }
}
- if (virt != VMPA_NO_VIRTUAL)
+ if (defined)
{
- /* TODO : utiliser format pour contruire une adresse avec une position physique,
- * ce qui accélèrerait les recherches.
- */
- init_vmpa(&addr, VMPA_NO_PHYSICAL, virt);
-
switch_ins = g_arch_processor_find_instr_by_address(proc, &addr);
if (G_IS_DALVIK_SWITCH_INSTR(switch_ins))