arm64: LDR operands[1] is memory operand. fix issue #1481

This commit is contained in:
Nguyen Anh Quynh 2019-05-16 21:29:51 +08:00
parent e3edf79e7e
commit 832180d695
3 changed files with 10 additions and 2 deletions

View File

@ -24028,7 +24028,12 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, MCRegisterInfo *MRI)
printOperand(MI, (unsigned)(AsmString[I++]) - 1, OS);
}
} else {
SStream_concat1(OS, AsmString[I++]);
if (AsmString[I] == '[') {
set_mem_access(MI, true);
} else if (AsmString[I] == ']') {
set_mem_access(MI, false);
}
SStream_concat1(OS, AsmString[I++]);
}
} while (AsmString[I] != '\0');
}

View File

@ -645,7 +645,6 @@ void AArch64_printInst(MCInst *MI, SStream *O, void *Info)
arm64_op_addVectorArrSpecifier(MI, ARM64_VAS_1S);
break;
}
} else {
printInstruction(MI, O);
}

View File

@ -1,3 +1,7 @@
!# issue 1481 ARM64 LDR operand2
!# CS_ARCH_ARM64, CS_MODE_LITTLE_ENDIAN, CS_OPT_DETAIL
0xe9,0x03,0x40,0xf9 == ldr x9, [sp] ; operands[1].mem.base: REG = sp
!# issue 968 PPC absolute branch: bdnzla
!# CS_ARCH_PPC, CS_MODE_64 | CS_MODE_BIG_ENDIAN, None
0x1000: 0x42,0x00,0x12,0x37 == bdnzla 0x1234