Skip to content

Commit

Permalink
Revert changing the backing type of mnemonics. This makes the code co…
Browse files Browse the repository at this point in the history
…mpile on stable but not on some nightly versions.
  • Loading branch information
th0rex committed Sep 30, 2017
1 parent 46f6ccd commit fa5db42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Decoder {
/// zydis::gen::ZYDIS_ADDRESS_WIDTH_64
/// ).unwrap();
/// let info = decoder.decode(INT3, 0x00400000).unwrap().unwrap();
/// assert_eq!(info.mnemonic as i32, zydis::gen::ZYDIS_MNEMONIC_INT3);
/// assert_eq!(info.mnemonic as u32, zydis::gen::ZYDIS_MNEMONIC_INT3);
/// ```
pub fn decode(
&self,
Expand Down
3 changes: 2 additions & 1 deletion src/mnemonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use gen::*;
use std::ffi::CStr;
use std::os::raw::c_uint;

/// Extensions for `ZydisMnemonic`
pub trait ZydisMnemonicMethods {
Expand All @@ -16,7 +17,7 @@ pub trait ZydisMnemonicMethods {
fn get_string(self) -> Option<&'static str>;
}

impl ZydisMnemonicMethods for i32 {
impl ZydisMnemonicMethods for c_uint {
fn get_string(self) -> Option<&'static str> {
unsafe { check_string!(ZydisMnemonicGetString(self as _)) }
}
Expand Down

0 comments on commit fa5db42

Please sign in to comment.