summaryrefslogtreecommitdiff
path: root/src/arch/dalvik/decomp/invoke.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2013-01-20 13:10:06 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2013-01-20 13:10:06 (GMT)
commit37fd2f1329c56078bc8a8b2fc955aa001c109c01 (patch)
tree71bcce9a3eaf6b7569d1f1d3e057752ae517ebde /src/arch/dalvik/decomp/invoke.c
parenta9bbd894bd25f7c2bb72fb7d4064b19377d90c6d (diff)
Took care of shared allocations between blocks when converting registers.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@326 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/dalvik/decomp/invoke.c')
-rw-r--r--src/arch/dalvik/decomp/invoke.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/arch/dalvik/decomp/invoke.c b/src/arch/dalvik/decomp/invoke.c
index 7337ccc..4b2f20f 100644
--- a/src/arch/dalvik/decomp/invoke.c
+++ b/src/arch/dalvik/decomp/invoke.c
@@ -62,6 +62,7 @@ GDecInstruction *dalvik_decomp_instr_invoke_direct(const GArchInstruction *instr
const char *name; /* Chaîne à afficher */
GDecInstruction *src; /* Source de l'assignation */
GDecInstruction *dest; /* Destination de l'assignat° */
+ vmpa_t addr; /* Adresse de l'instruction */
size_t i; /* Boucle de parcours #2 */
GArchOperand *arg; /* Argument brut de l'appel */
GDecInstruction *reg; /* Argument converti */
@@ -123,10 +124,12 @@ GDecInstruction *dalvik_decomp_instr_invoke_direct(const GArchInstruction *instr
operand = g_arch_instruction_get_operand(instr, 0);
count = g_dalvik_args_count(G_DALVIK_ARGS_OPERAND(operand));
+ g_arch_instruction_get_location(instr, NULL, NULL, &addr);
+
for (i = 1; i < count; i++)
{
arg = g_dalvik_args_operand_get(G_DALVIK_ARGS_OPERAND(operand), i);
- reg = g_dec_context_convert_register(ctx, arg, false);
+ reg = g_dec_context_convert_register(ctx, arg, false, addr);
g_routine_call_add_arg(G_ROUTINE_CALL(result), reg);
@@ -158,6 +161,7 @@ GDecInstruction *dalvik_decomp_instr_invoke_static(const GArchInstruction *instr
uint32_t index; /* Indice de l'élément visé */
GBinRoutine *routine; /* Routine visée par l'appel */
GDecInstruction *call; /* Représentation de l'appel */
+ vmpa_t addr; /* Adresse de l'instruction */
size_t i; /* Boucle de parcours #2 */
GArchOperand *arg; /* Argument brut de l'appel */
GDecInstruction *reg; /* Argument converti */
@@ -181,10 +185,12 @@ GDecInstruction *dalvik_decomp_instr_invoke_static(const GArchInstruction *instr
operand = g_arch_instruction_get_operand(instr, 0);
count = g_dalvik_args_count(G_DALVIK_ARGS_OPERAND(operand));
+ g_arch_instruction_get_location(instr, NULL, NULL, &addr);
+
for (i = 0; i < count; i++)
{
arg = g_dalvik_args_operand_get(G_DALVIK_ARGS_OPERAND(operand), i);
- reg = g_dec_context_convert_register(ctx, arg, false);
+ reg = g_dec_context_convert_register(ctx, arg, false, addr);
g_routine_call_add_arg(G_ROUTINE_CALL(call), reg);
@@ -216,6 +222,7 @@ GDecInstruction *dalvik_decomp_instr_invoke_virtual(const GArchInstruction *inst
uint32_t index; /* Indice de l'élément visé */
GBinRoutine *routine; /* Routine visée par l'appel */
GDecInstruction *call; /* Représentation de l'appel */
+ vmpa_t addr; /* Adresse de l'instruction */
size_t i; /* Boucle de parcours #2 */
GArchOperand *arg; /* Argument brut de l'appel */
GDecInstruction *reg; /* Argument converti */
@@ -239,10 +246,12 @@ GDecInstruction *dalvik_decomp_instr_invoke_virtual(const GArchInstruction *inst
operand = g_arch_instruction_get_operand(instr, 0);
count = g_dalvik_args_count(G_DALVIK_ARGS_OPERAND(operand));
+ g_arch_instruction_get_location(instr, NULL, NULL, &addr);
+
for (i = 1; i < count; i++)
{
arg = g_dalvik_args_operand_get(G_DALVIK_ARGS_OPERAND(operand), i);
- reg = g_dec_context_convert_register(ctx, arg, false);
+ reg = g_dec_context_convert_register(ctx, arg, false, addr);
g_routine_call_add_arg(G_ROUTINE_CALL(call), reg);
@@ -251,7 +260,7 @@ GDecInstruction *dalvik_decomp_instr_invoke_virtual(const GArchInstruction *inst
/* Appel depuis le propriétaire */
arg = g_dalvik_args_operand_get(G_DALVIK_ARGS_OPERAND(operand), 0);
- reg = g_dec_context_convert_register(ctx, arg, false);
+ reg = g_dec_context_convert_register(ctx, arg, false, addr);
result = g_access_expression_new(G_DEC_EXPRESSION(reg), G_DEC_EXPRESSION(call));