Fix black_box bug detected by Amanieu
Co-authored-by: Amanieu <amanieu@gmail.com>
This commit is contained in:
parent
87666e5bce
commit
4dc4e9f671
@ -122,7 +122,7 @@ pub fn black_box<T>(mut dummy: T) -> T {
|
||||
// SAFETY: the inline assembly is a no-op.
|
||||
unsafe {
|
||||
// FIXME: Cannot use `asm!` because it doesn't support MIPS and other architectures.
|
||||
llvm_asm!("" : : "r"(&mut dummy));
|
||||
llvm_asm!("" : : "r"(&mut dummy) : "memory" : "volatile");
|
||||
}
|
||||
|
||||
dummy
|
||||
|
Loading…
x
Reference in New Issue
Block a user