mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-18 21:14:35 +03:00
[Bug] Fixed a ModRM/MR check in X86 assembler (mov instruction) (fixes #392)
This commit is contained in:
@@ -493,11 +493,11 @@ static ASMJIT_FORCE_INLINE uint32_t x86GetMovAbsInstSize64Bit(uint32_t regSize,
|
|||||||
static ASMJIT_FORCE_INLINE bool x86ShouldUseMovabs(Assembler* self, X86BufferWriter& writer, uint32_t regSize, InstOptions options, const Mem& rmRel) noexcept {
|
static ASMJIT_FORCE_INLINE bool x86ShouldUseMovabs(Assembler* self, X86BufferWriter& writer, uint32_t regSize, InstOptions options, const Mem& rmRel) noexcept {
|
||||||
if (self->is32Bit()) {
|
if (self->is32Bit()) {
|
||||||
// There is no relative addressing, just decide whether to use MOV encoded with MOD R/M or absolute.
|
// There is no relative addressing, just decide whether to use MOV encoded with MOD R/M or absolute.
|
||||||
return !Support::test(options, InstOptions::kX86_ModMR | InstOptions::kX86_ModMR);
|
return !Support::test(options, InstOptions::kX86_ModMR | InstOptions::kX86_ModRM);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If the addressing type is REL or MOD R/M was specified then absolute mov won't be used.
|
// If the addressing type is REL or MOD R/M was specified then absolute mov won't be used.
|
||||||
if (rmRel.addrType() == Mem::AddrType::kRel || Support::test(options, InstOptions::kX86_ModMR))
|
if (rmRel.addrType() == Mem::AddrType::kRel || Support::test(options, InstOptions::kX86_ModMR | InstOptions::kX86_ModRM))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int64_t addrValue = rmRel.offset();
|
int64_t addrValue = rmRel.offset();
|
||||||
|
|||||||
Reference in New Issue
Block a user