Index: trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp =================================================================== --- trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp (revision 555890) +++ trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp (working copy) @@ -227,11 +227,13 @@ break; case OpndKind_Mem: { + /* RegName segReg = p->getSegReg(); if (segReg == RegName_FS) { stream = (uint8*)EncoderBase::prefix((char*)stream, InstPrefix_FS); } + */ const Opnd * pbase = p->getMemOpndSubOpnd(MemOpndSubOpndKind_Base); @@ -267,8 +269,9 @@ // Emit prefix here - so it relates to the real instruction // emitted alter, rather that to the hidden MOV inserted above InstPrefix instPrefix = getInstPrefixFromSReg(p->getSegReg()); - if (instPrefix != InstPrefix_Null) { - stream = (uint8*)EncoderBase::prefix((char*)stream, instPrefix); + if (instPrefix != InstPrefix_Null && + inst->getPrefix() == InstPrefix_Null) { + stream = (uint8*)EncoderBase::prefix((char*)stream, instPrefix); } } break; @@ -287,7 +290,7 @@ } //emit inst prefix - if (inst->getPrefix()!=InstPrefix_Null) { + if (inst->getPrefix() != InstPrefix_Null) { stream = (uint8*)EncoderBase::prefix((char*)stream, inst->getPrefix()); } return (uint8*)EncoderBase::encode((char*)stream, mnemonic, args);