Signed-off-by: Vegard Nossum <[email protected]>
---
arch/x86/emit-code.c | 2 +-
arch/x86/include/arch/instruction.h | 1 +
arch/x86/instruction.c | 12 +++++++++++-
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index 887c716..141c5fc 100644
--- a/arch/x86/emit-code.c
+++ b/arch/x86/emit-code.c
@@ -1069,7 +1069,7 @@ static void __emit_test_imm_memdisp(struct buffer *buf,
static void emit_test_imm_memdisp(struct buffer *buf,
struct operand *imm, struct operand *disp)
{
- __emit_test_imm_memdisp(buf, imm->imm, disp->imm);
+ __emit_test_imm_memdisp(buf, imm->imm, disp->disp);
}
void emit_prolog(struct buffer *buf, unsigned long nr_locals)
diff --git a/arch/x86/include/arch/instruction.h
b/arch/x86/include/arch/instruction.h
index df9dab2..2b6b266 100644
--- a/arch/x86/include/arch/instruction.h
+++ b/arch/x86/include/arch/instruction.h
@@ -20,6 +20,7 @@ enum operand_type {
OPERAND_BRANCH,
OPERAND_IMM,
OPERAND_MEMBASE,
+ OPERAND_MEMDISP,
OPERAND_MEMINDEX,
OPERAND_MEMLOCAL,
OPERAND_REG,
diff --git a/arch/x86/instruction.c b/arch/x86/instruction.c
index 720dfec..c8e1044 100644
--- a/arch/x86/instruction.c
+++ b/arch/x86/instruction.c
@@ -110,6 +110,16 @@ static void init_membase_operand(struct insn *insn,
unsigned long idx,
init_register(&operand->base_reg, insn, base_reg->interval);
}
+static void init_memdisp_operand(struct insn *insn, unsigned long idx,
+ unsigned long disp)
+{
+ struct operand *operand;
+
+ operand = &insn->operands[idx];
+ operand->type = OPERAND_MEMDISP;
+ operand->disp = disp;
+}
+
static void init_memindex_operand(struct insn *insn, unsigned long idx,
struct var_info *base_reg,
struct var_info *index_reg, unsigned long
shift)
@@ -285,7 +295,7 @@ struct insn *imm_memdisp_insn(enum insn_type insn_type,
long imm, long disp)
struct insn *insn = alloc_insn(insn_type);
if (insn) {
init_imm_operand(insn, 0, imm);
- init_imm_operand(insn, 1, imm);
+ init_memdisp_operand(insn, 1, disp);
}
return insn;
}
--
1.6.0.6
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jatovm-devel