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.61k stars 1.56k forks source link

Fix incorrect setup of `mnemonic` and `op_str` field. #2192

Closed Rot127 closed 1 year ago

Rot127 commented 1 year ago

Some alias instructions have a leading space or tab in the asm text (no idea why LLVM does that). Because of that the mnemonic and op_str were never properly separated, because stops looking for the mnemonic at the first tab/space occurrence.

So we simply check for leading blank chars in the asm text and remove them.

closes https://github.com/capstone-engine/capstone/issues/2189

kabeor commented 1 year ago

Merged.