capstone-rust / capstone-rs

high-level Capstone system bindings for Rust
213 stars 75 forks source link

Fix cs_support enum bug #160

Closed GarntS closed 2 months ago

GarntS commented 2 months ago

The enum capstone::Arch doesn't have the same values as capstone's cs_arch enum. This causes calls to supports_arch() to return incorrect results once the enum values diverge, which happens for riscv and a few others.

Fortunately, capstone_sys::cs_arch has a From<capstone::Arch> implementation, so we can just use that to do the correct conversion.

tmfink commented 2 months ago

thanks for the fix!