aboutsummaryrefslogtreecommitdiff
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:14:41 +0100
commit995963852c589aae9487fdd6c20d898cf678ba04 (patch)
tree14f7ee802b479e6de56322333a8c495318be4949
parent3e372cf87fa0d9ab378c3dffed6b863bef4ed7a3 (diff)
downloadqemu-995963852c589aae9487fdd6c20d898cf678ba04.zip
qemu-995963852c589aae9487fdd6c20d898cf678ba04.tar.gz
qemu-995963852c589aae9487fdd6c20d898cf678ba04.tar.bz2
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>
-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 64bc0a3..511a4ea 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);