capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.51k stars 1.54k forks source link

[PPC] Fix #2401 - incorrect operands in disassembled instructions #2403

Closed valdaarhun closed 2 months ago

valdaarhun commented 2 months ago

Your checklist for this pull request

Detailed description

Disassembling the "slwi", "srwi" and "rldicr" PowerPC instructions with the "-d" option displays the wrong operands in detailed information. This is due to an incorrect break condition in PPC_insert_detail_op_imm_at()

Test plan

Please let me know if this should be added in the testsuite too. I am not sure how one does that.

Closing issues

closes #2401

Rot127 commented 2 months ago

Thanks a lot! I check it tomorrow. But you can add a test case in the issue.cs file. The one in <repo-root>/tests/cs_detail/. Just do it as the other tests there.

valdaarhun commented 2 months ago

Thanks a lot! I check it tomorrow. But you can add a test case in the issue.cs file. The one in <repo-root>/tests/cs_detail/. Just do it as the other tests there.

Hi, thank you for your reply. I have added three test cases to issue.cs.