%r13 requires special treatment, otherwise emitted code is bogus.

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munte...@linux360.ro>
---
 arch/x86/emit-code.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index 5e3872b..37c397a 100644
--- a/arch/x86/emit-code.c
+++ b/arch/x86/emit-code.c
@@ -2800,12 +2800,8 @@ static void emit_cmp_reg_reg(struct buffer *buf,
 
 static void emit_indirect_call(struct buffer *buf, struct operand *operand)
 {
-       unsigned char reg = encode_reg(&operand->reg);
-
-       if (reg_high(reg))
-               emit(buf, REX_B);
-       emit(buf, 0xff);
-       emit(buf, encode_modrm(0x0, 0x2, reg));
+       /* Go through __emit_membase() to handle %r13. */
+       __emit_membase(buf, 0, 0xff, mach_reg(&operand->reg), 0, 0x2);
 }
 
 static void __emit_test_imm_memdisp(struct buffer *buf,
-- 
1.6.0.6


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to