Skip to content

Incorrect reg_access in some AArch64 instructions #2385

@Kashio

Description

@Kashio

Work environment

Questions Answers
OS/arch/bits Windows x64
Architecture armv8.
Source of Capstone git clone, brew, pip, release binaries etc.
Version/git commit v5.0.1

Instruction bytes giving faulty results

0x1f, 0x00, 0x01, 0xeb

Expected results

It should be:

([219], [4])

Steps to get the wrong result

With Python

CODE = b"\x1f\x00\x01\xeb"

md = Cs(CS_ARCH_ARM64, CS_MODE_ARM)
md.detail = True
for insn in md.disasm(CODE, 0x1000):
  inst.regs_access() # Prints ([219], [4, 218])

Additional Logs, screenshots, source code, configuration dump, ...

As far as I know and looking a the pseudo code for the instruction, the first source operand here x0 shouldn't be modified and reg_access reports it as being written to. I see this behaviour with more instructions like cmn etc..

Metadata

Metadata

Assignees

No one assigned

    Labels

    ARMArchbugSomething is not working as it should

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions