summaryrefslogtreecommitdiff
path: root/src/arch/link.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-04-25 21:35:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-04-25 21:35:19 (GMT)
commitee0ff01247738e847ae3faa44dcb5168d7b758ba (patch)
treee945f95a84a97237debf0b16ee11ed95d6862afb /src/arch/link.c
parent2a1dd967d3b4e06f504431f9d3d613992095b2c3 (diff)
Registered suitable linkage hooks and defined right links between instructions.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@519 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/link.c')
-rw-r--r--src/arch/link.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/arch/link.c b/src/arch/link.c
index bc80e39..02cda22 100644
--- a/src/arch/link.c
+++ b/src/arch/link.c
@@ -79,6 +79,7 @@ void handle_jump_as_link(GArchInstruction *instr, GArchProcessor *proc, GProcCon
* proc = représentation de l'architecture utilisée. *
* context = contexte associé à la phase de désassemblage. *
* format = acès aux données du binaire d'origine. *
+* index = indice de l'opérande à traiter dans l'instruction. *
* *
* Description : Etablit un lien d'appel selon une instruction donnée. *
* *
@@ -87,8 +88,8 @@ void handle_jump_as_link(GArchInstruction *instr, GArchProcessor *proc, GProcCon
* Remarques : - *
* *
******************************************************************************/
-#include "instruction-int.h"
-void handle_branch_if_true_as_link(GArchInstruction *instr, GArchProcessor *proc, GProcContext *context, GBinFormat *format)
+#include "instruction-int.h" // REMME
+void handle_branch_as_link(GArchInstruction *instr, GArchProcessor *proc, GProcContext *context, GBinFormat *format, size_t index)
{
GArchOperand *op; /* Opérande numérique en place */
virt_t virt; /* Adresse virtuelle */
@@ -96,9 +97,9 @@ void handle_branch_if_true_as_link(GArchInstruction *instr, GArchProcessor *proc
GArchInstruction *target; /* Ligne visée par la référence*/
GArchInstruction *list; /* Ensemble des instructions */
- assert(g_arch_instruction_count_operands(instr) > 0);
+ assert(g_arch_instruction_count_operands(instr) > index);
- op = g_arch_instruction_get_operand(instr, 0);
+ op = g_arch_instruction_get_operand(instr, index);
virt = VMPA_NO_VIRTUAL;