diff --git a/src/arch/x86/emulenv.cc b/src/arch/x86/emulenv.cc index 44afc5acc9..b62829341a 100644 --- a/src/arch/x86/emulenv.cc +++ b/src/arch/x86/emulenv.cc @@ -100,18 +100,16 @@ 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) || machInst.dispSize) { + //Figure out what segment to use. + if (base != INTREG_RBP && base != INTREG_RSP) { seg = SEGMENT_REG_DS; - //Handle any segment override that might have been in the instruction - int segFromInst = machInst.legacy.seg; - if (segFromInst) - seg = (SegmentRegIndex)(segFromInst - 1); } else { seg = SEGMENT_REG_SS; } + //Handle any segment override that might have been in the instruction + int segFromInst = machInst.legacy.seg; + if (segFromInst) + seg = (SegmentRegIndex)(segFromInst - 1); } void EmulEnv::setSeg(const ExtMachInst & machInst)