about summary refs log tree commit diff
path: root/library/stdarch/crates/assert-instr-macro/src
diff options
context:
space:
mode:
authorgnzlbg <gonzalobg88@gmail.com>2019-07-08 13:13:30 +0200
committergnzlbg <gnzlbg@users.noreply.github.com>2019-07-08 13:15:07 +0200
commit832259621cbd713a9e5039483ce596c30833107a (patch)
treea7191a5c1c546043bfdff869fe89506813a6afd8 /library/stdarch/crates/assert-instr-macro/src
parent657f77887190860356d80321a8e4054301002ccb (diff)
downloadrust-832259621cbd713a9e5039483ce596c30833107a.tar.gz
rust-832259621cbd713a9e5039483ce596c30833107a.zip
Fix data-race in assert_instr
Diffstat (limited to 'library/stdarch/crates/assert-instr-macro/src')
-rw-r--r--library/stdarch/crates/assert-instr-macro/src/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/stdarch/crates/assert-instr-macro/src/lib.rs b/library/stdarch/crates/assert-instr-macro/src/lib.rs
index ba33dcfda92..f5ae347ee15 100644
--- a/library/stdarch/crates/assert-instr-macro/src/lib.rs
+++ b/library/stdarch/crates/assert-instr-macro/src/lib.rs
@@ -112,7 +112,10 @@ pub fn assert_instr(
             // generate some code that's hopefully very tight in terms of
             // codegen but is otherwise unique to prevent code from being
             // folded.
-            ::stdsimd_test::_DONT_DEDUP = #shim_name_str;
+            ::stdsimd_test::_DONT_DEDUP.store(
+                std::mem::transmute(#shim_name_str.as_bytes().as_ptr()),
+                std::sync::atomic::Ordering::Relaxed,
+            );
             #name(#(#input_vals),*)
         }
     };