Skip to content

Commit 9282992

Browse files
committed
update asm code to working state
1 parent 9304c62 commit 9282992

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/arch/x86/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ mod tests {
1414
use crate::error::{Error, Result};
1515
use crate::RawDetour;
1616
use matches::assert_matches;
17+
use std::arch::asm;
1718
use std::mem;
1819

1920
/// Default test case function definition.
@@ -43,12 +44,12 @@ mod tests {
4344
asm!(
4445
"
4546
xor eax, eax
46-
je ret5
47+
je 5f
4748
mov eax, 2
48-
jmp done
49-
ret5:
49+
jmp 1f
50+
5:
5051
mov eax, 5
51-
done:
52+
1:
5253
ret",
5354
options(noreturn)
5455
);
@@ -102,11 +103,11 @@ mod tests {
102103
unsafe extern "C" fn external_loop() -> i32 {
103104
asm!(
104105
"
105-
loop dest
106+
loop 1f
106107
nop
107108
nop
108109
nop
109-
dest:",
110+
1:",
110111
options(noreturn)
111112
);
112113
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![cfg_attr(feature = "nightly", feature(unboxed_closures, abi_thiscall))]
33
#![cfg_attr(
44
all(feature = "nightly", test),
5-
feature(naked_functions, core_intrinsics, asm)
5+
feature(naked_functions, core_intrinsics)
66
)]
77

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

0 commit comments

Comments
 (0)