|
@@ -1177,6 +1177,9 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt,
|
|
|
}
|
|
|
}
|
|
|
op->addr.mem.ea = modrm_ea;
|
|
|
+ if (ctxt->ad_bytes != 8)
|
|
|
+ ctxt->memop.addr.mem.ea = (u32)ctxt->memop.addr.mem.ea;
|
|
|
+
|
|
|
done:
|
|
|
return rc;
|
|
|
}
|
|
@@ -4425,9 +4428,6 @@ done_prefixes:
|
|
|
|
|
|
ctxt->memop.addr.mem.seg = ctxt->seg_override;
|
|
|
|
|
|
- if (ctxt->memop.type == OP_MEM && ctxt->ad_bytes != 8)
|
|
|
- ctxt->memop.addr.mem.ea = (u32)ctxt->memop.addr.mem.ea;
|
|
|
-
|
|
|
/*
|
|
|
* Decode and fetch the source operand: register, memory
|
|
|
* or immediate.
|
|
@@ -4448,7 +4448,7 @@ done_prefixes:
|
|
|
rc = decode_operand(ctxt, &ctxt->dst, (ctxt->d >> DstShift) & OpMask);
|
|
|
|
|
|
done:
|
|
|
- if (ctxt->memopp && ctxt->memopp->type == OP_MEM && ctxt->rip_relative)
|
|
|
+ if (ctxt->rip_relative)
|
|
|
ctxt->memopp->addr.mem.ea += ctxt->_eip;
|
|
|
|
|
|
return (rc != X86EMUL_CONTINUE) ? EMULATION_FAILED : EMULATION_OK;
|