summaryrefslogtreecommitdiff
path: root/src/arch/x86/emulenv.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-08-03 11:01:40 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-08-03 11:01:40 -0700
commit676dc6d29287e15cb37b367a15a2e7c64f9c9007 (patch)
tree6339af0073a661fa22bb18c3a129a8ae9dc39f69 /src/arch/x86/emulenv.cc
parent38c2af17a557e5b7420a2ad15b13316acbde588d (diff)
downloadgem5-676dc6d29287e15cb37b367a15a2e7c64f9c9007.tar.xz
X86: Fix segment override prefixes on instructions that use rbp/rsp and a displacement.
Diffstat (limited to 'src/arch/x86/emulenv.cc')
-rw-r--r--src/arch/x86/emulenv.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/arch/x86/emulenv.cc b/src/arch/x86/emulenv.cc
index 8e4600a14..7e4a9fc55 100644
--- a/src/arch/x86/emulenv.cc
+++ b/src/arch/x86/emulenv.cc
@@ -118,8 +118,7 @@ void EmulEnv::doModRM(const ExtMachInst & machInst)
//Figure out what segment to use. This won't be entirely accurate since
//the presence of a displacement is supposed to make the instruction
//default to the data segment.
- if ((base != INTREG_RBP && base != INTREG_RSP) ||
- 0/*Has an immediate offset*/) {
+ if ((base != INTREG_RBP && base != INTREG_RSP) || machInst.dispSize) {
seg = SEGMENT_REG_DS;
//Handle any segment override that might have been in the instruction
int segFromInst = machInst.legacy.seg;