summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2010-01-03 03:08:19 +0100
committerAurelien Jarno <aurelien@aurel32.net>2010-01-03 03:16:59 +0100
commit76ba04832b5b27e67c5f4d58b9937d810108d0b6 (patch)
treed3d66a9aceadec91895ae52b6392409acb6c572f /target-i386
parentAdd missing newline at the end of options list (diff)
downloadqemu-kvm-76ba04832b5b27e67c5f4d58b9937d810108d0b6.tar.gz
qemu-kvm-76ba04832b5b27e67c5f4d58b9937d810108d0b6.tar.bz2
qemu-kvm-76ba04832b5b27e67c5f4d58b9937d810108d0b6.zip
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 <kevin@koconnor.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/translate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 64bc0a3f3..511a4eae9 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);