RISC-V encoding bug
Some if statements in RISCVAsmBackend.cpp were intended to have multiple statements, but are missing braces. This causes the beq instruction to be encoded as -1 (FF FF FF FF)
https://github.com/keystone-engine/keystone/blob/fb92f32391c6cced868252167509590319eeb58b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp#L201
That code is from LLVM 3.9.0, LLVM's current release is 21.1.0. This project really should update LLVM.
I don't see any problem with the old LLVM, it's just that the person who backported RISC-V support made a dumb mistake lol
https://github.com/keystone-engine/keystone/pull/549/files
Says:
- adds the support for RISC-V architecture (refers to #491) from LLVM 9.0.1 version - the first official release of RISC-V to LLVM
Surely, the RISC-V support from LLVM 9 isn't as stable as something like 21. That's about 6 years of improvements.