capstone icon indicating copy to clipboard operation
capstone copied to clipboard

Incorrect access types for some AArch64 aliased instructions

Open FinnWilkinson opened this issue 3 years ago • 0 comments

PR #1655 provided a fix for some alias instructions where the incorrect access type was being fetched due to a change in the number of operands. For example, cmp x0, x1 is an alias of subs xzr, x0, x1, and the access rights for cmp are WRITE, READ respectively, when they should be READ, READ.

The fix from #1655 changes the printOperand function to use OpNum instead of MI->ac_idx to retrieve the access type from the map; which works for the case above, but for other instructions it retrieves the incorrect types. For example, ldrsw x2, [x0], #4 should have access types x2=WRITE, [x0]=READ | WRITE, however with the change from #1655 the access types are x2=READ | WRITE, [x0]=READ | WRITE.

PR #1907 reverts the change made from #1655, as another solution will need implementing to ensure the access types are correct for all instructions, including aliases

FinnWilkinson avatar Aug 11 '22 11:08 FinnWilkinson