AArch64: Replace vararg add_cs_detail by multiple concrete functions
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.
Added. Keep in mind the bug in the original code does not manifest itself on current mainstream architectures.
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.
Sure, rebased now.