arm: alias LDR [sp], 4 to POP

This commit is contained in:
Nguyen Anh Quynh 2019-04-16 00:01:54 +08:00
parent 98914af194
commit 40405afffe
2 changed files with 5 additions and 1 deletions

View File

@ -680,7 +680,7 @@ void ARM_printInst(MCInst *MI, SStream *O, void *Info)
if (MCOperand_getReg(MCInst_getOperand(MI, 2)) == ARM_SP) {
MCOperand *MO2 = MCInst_getOperand(MI, 4);
if (MCOperand_getImm(MO2) == 4) {
if (getAM2Offset((unsigned int)MCOperand_getImm(MO2)) == 4) {
SStream_concat0(O, "pop");
MCInst_setOpcodePub(MI, ARM_INS_POP);
printPredicateOperand(MI, 5, O);

View File

@ -1,3 +1,7 @@
!# issue 1456 ARM POP
!# CS_ARCH_ARM, CS_MODE_LITTLE_ENDIAN, None
0x04,0x10,0x9d,0xe4 == pop {r1}
!# issue 1456
!# CS_ARCH_ARM, CS_MODE_LITTLE_ENDIAN, CS_OPT_DETAIL
0x31,0x02,0xa0,0xe1 == lsr r0, r1, r2 ; operands[2].type: REG = r2