Skip to content

Commit

Permalink
Use old asm! syntax
Browse files Browse the repository at this point in the history
The new asm! syntax is currently unable to do this trick, see
rust-lang/rust#72965 for details.
  • Loading branch information
cesarb committed Jun 4, 2020
1 parent 43cd2be commit ce59e69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/hide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ mod impls {
#[inline]
default fn hide_mem_impl(ptr: *mut Self) {
unsafe {
// llvm_asm!("" : : "r" (ptr as *mut u8) : "memory");
asm!("", in(reg) (ptr as *mut u8), options(nostack));
llvm_asm!("" : : "r" (ptr as *mut u8) : "memory");
// asm!("", in(reg) (ptr as *mut u8), options(nostack));
}
}
}
Expand All @@ -45,8 +45,8 @@ mod impls {
#[inline]
fn hide_mem_impl(ptr: *mut Self) {
unsafe {
// llvm_asm!("" : "=*m" (ptr) : "*0" (ptr));
asm!("", in(reg) ptr, options(nostack));
llvm_asm!("" : "=*m" (ptr) : "*0" (ptr));
// asm!("", in(reg) ptr, options(nostack));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg_attr(not(test), no_std)]
#![cfg_attr(feature = "nightly", feature(asm, i128_type, specialization))]
#![cfg_attr(feature = "nightly", feature(llvm_asm, i128_type, specialization))]
#![deny(missing_docs)]

//! Helpers for clearing sensitive data on the stack and heap.
Expand Down

0 comments on commit ce59e69

Please sign in to comment.