Open adamjseitz opened 2 years ago
I encountered the same issue. Please fix it.
bug reproduction:
from capstone import Cs, CS_ARCH_ARM, CS_MODE_THUMB
cs = Cs(CS_ARCH_ARM, CS_MODE_THUMB)
cs.detail = True
inst = list(cs.disasm(bytearray([0x57, 0xf8, 0x23, 0x00]), 0))[0]
print(inst.op_str)
op1 = inst.operands[1]
print(op1.mem.lshift)
print(op1.shift.value)
For the following ARM instruction's memory operand, capstone reports
op.shift.value
of2
, butop.mem.lshift
of0
.The header file seems to suggest that these values should be the same:
This can be worked around by using
op.shift.value
, but I think the values should match.I identified this bug on commit 9759b6e3f712e232ec19b4281d41220d4dea4a55, the latest on the
next
branch.Sample code:
Output: