Select proper operand for LEA processing in AT&T mode.

This commit is contained in:
Bartosz Taudul 2020-05-15 01:37:08 +02:00
parent 992fba7e07
commit 03c3a3e7c7

View File

@ -685,8 +685,9 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker )
if( ( m_cpuArch == CpuArchX64 || m_cpuArch == CpuArchX86 ) && op.id == X86_INS_LEA )
{
assert( op.detail->x86.op_count == 2 );
assert( op.detail->x86.operands[1].type == X86_OP_MEM );
auto& mem = op.detail->x86.operands[1].mem;
const auto opidx = m_atnt ? 0 : 1;
assert( op.detail->x86.operands[opidx].type == X86_OP_MEM );
auto& mem = op.detail->x86.operands[opidx].mem;
if( mem.base == X86_REG_INVALID )
{
if( mem.index == X86_REG_INVALID )