Skip to content

Find writeback registers#2960

Open
slate5 wants to merge 1 commit into
capstone-engine:nextfrom
slate5:fix/writeback-riscv
Open

Find writeback registers#2960
slate5 wants to merge 1 commit into
capstone-engine:nextfrom
slate5:fix/writeback-riscv

Conversation

@slate5

@slate5 slate5 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Your checklist for this pull request

  • I've documented or updated the documentation of every API function and struct this PR changes.
  • I've added tests that prove my fix is effective or that my feature works (if possible)

Detailed description

Detection of writebacks was only partially implemented:

  • MCInst_handleWriteback() was not called, so tied_op_idx was not filled
  • map_get_op_access() in RISCV_add_cs_detail_0() queried tied_op_idx unnecessarily, because all elements were -1 (initialization value)

This uses auto-sync to find writebacks instead of having a custom function in arch/RISCV/

Test plan

...

Closing issues

...

Detection of writebacks was only partially implemented:
- MCInst_handleWriteback() was not called, so tied_op_idx was not filled
- map_get_op_access() in RISCV_add_cs_detail_0() queried tied_op_idx
  unnecessarily, because all elements were -1 (initialization value)
@github-actions github-actions Bot added the RISCV Arch label Jun 9, 2026

@Rot127 Rot127 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the instruction which let you find the bug as test.

@slate5

slate5 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

I didn't, i could run a lot of instructions in the hope of finding a discrepancy between manually setting RW access (as it was) and relying on auto-sync.

I came across this accidentally, and i thought it's neater and more robust...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RISCV Arch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants