Skip to content

Commit

Permalink
arch: Fix widening issues when dst is gpr register on x86_64. (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkorenc authored Apr 21, 2021
1 parent f096390 commit 8b5f739
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Arch/X86/Arch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,9 @@ static void DecodeRegister(Instruction &inst, const xed_decoded_inst_t *xedd,
if (xed_operand_written(xedo)) {
op.action = Operand::kActionWrite;
if (Is64Bit(inst.arch_name)) {
if (XED_REG_GPR32_FIRST <= reg && XED_REG_GPR32_LAST > reg) {
op.reg.name[0] = 'R'; // Convert things like `EAX` into `RAX`.
op.size = 64;
op.reg.size = 64;
if (XED_REG_GPR32_FIRST <= reg && XED_REG_GPR32_LAST >= reg) {
op.reg = RegOp(xed_get_largest_enclosing_register(reg));
op.size = op.reg.size;

} else if (XED_REG_XMM_FIRST <= reg && XED_REG_ZMM_LAST >= reg) {
if (kArchAMD64_AVX512 == inst.arch_name) {
Expand Down

0 comments on commit 8b5f739

Please sign in to comment.