From 76ba04832b5b27e67c5f4d58b9937d810108d0b6 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sun, 3 Jan 2010 03:08:19 +0100 Subject: [PATCH] target-i386: Fix "call im" on x86_64 when executing 32-bit code Similarly to what is done in 32938e127f50a40844a0fb9c5abb8691aeeccf7e for "jmp im", trunc the immediate to 32-bit when not running in 64-bit mode. Reported-by: Kevin O'Connor Signed-off-by: Aurelien Jarno --- target-i386/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target-i386/translate.c b/target-i386/translate.c index 64bc0a3f39..511a4eae9b 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -6259,6 +6259,8 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) tval += next_eip; if (s->dflag == 0) tval &= 0xffff; + else if(!CODE64(s)) + tval &= 0xffffffff; gen_movtl_T0_im(next_eip); gen_push_T0(s); gen_jmp(s, tval); -- 2.11.4.GIT