capstone icon indicating copy to clipboard operation
capstone copied to clipboard

AArch64: Replace vararg add_cs_detail by multiple concrete functions

Open thestr4ng3r opened this issue 1 year ago • 2 comments

Your checklist for this pull request

  • [x] 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) - current tests should be sufficient.

Detailed description

Fixes UB caused by various mismatches on how these arguments are passed and read. This became visible when running on PowerPC hosts with e.g. cstool -d aarch64 204862f8. Apart from the UB fix, this is meant to be a pure refactor.

Test plan

see https://github.com/capstone-engine/capstone/issues/2458#issuecomment-2389210291

Closing issues

Partially addresses #2458 Mips, PPC and Xtensa still have potentially problematic varargs.

thestr4ng3r avatar Oct 13 '24 15:10 thestr4ng3r

Added. Keep in mind the bug in the original code does not manifest itself on current mainstream architectures.

thestr4ng3r avatar Oct 16 '24 16:10 thestr4ng3r

Added. Keep in mind the bug in the original code does not manifest itself on current mainstream architectures.

Yes, I am aware. But I want to have it in case someone starts using Capstone on another weird machine. So just general test case coverage.

Rot127 avatar Oct 17 '24 11:10 Rot127

Sure, rebased now.

thestr4ng3r avatar Oct 21 '24 20:10 thestr4ng3r