Skip to content

Commit

Permalink
update asm code to working state
Browse files Browse the repository at this point in the history
  • Loading branch information
Hpmason committed Nov 14, 2022
1 parent 9304c62 commit 9282992
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/arch/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mod tests {
use crate::error::{Error, Result};
use crate::RawDetour;
use matches::assert_matches;
use std::arch::asm;
use std::mem;

/// Default test case function definition.
Expand Down Expand Up @@ -43,12 +44,12 @@ mod tests {
asm!(
"
xor eax, eax
je ret5
je 5f
mov eax, 2
jmp done
ret5:
jmp 1f
5:
mov eax, 5
done:
1:
ret",
options(noreturn)
);
Expand Down Expand Up @@ -102,11 +103,11 @@ mod tests {
unsafe extern "C" fn external_loop() -> i32 {
asm!(
"
loop dest
loop 1f
nop
nop
nop
dest:",
1:",
options(noreturn)
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![cfg_attr(feature = "nightly", feature(unboxed_closures, abi_thiscall))]
#![cfg_attr(
all(feature = "nightly", test),
feature(naked_functions, core_intrinsics, asm)
feature(naked_functions, core_intrinsics)
)]

//! A cross-platform detour library written in Rust.
Expand Down

0 comments on commit 9282992

Please sign in to comment.