about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2017-08-01 20:41:17 -0700
committerRalf Jung <post@ralfj.de>2017-08-03 18:12:26 -0700
commit85dc3e563ea52f54e57f1a1f2422c54c3680e2ec (patch)
treedd47677f8a642c87cc46a18b90142f90f6c5f9fc
parentc2c05014af8bb1eb78c8de30b092cc854dd29421 (diff)
downloadrust-85dc3e563ea52f54e57f1a1f2422c54c3680e2ec.tar.gz
rust-85dc3e563ea52f54e57f1a1f2422c54c3680e2ec.zip
make execution with full MIR work: need to whitelist Arc drop impl and whatever it calls
-rw-r--r--src/librustc_mir/interpret/validation.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/librustc_mir/interpret/validation.rs b/src/librustc_mir/interpret/validation.rs
index a6c2871cf52..4454e21b1aa 100644
--- a/src/librustc_mir/interpret/validation.rs
+++ b/src/librustc_mir/interpret/validation.rs
@@ -42,18 +42,24 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
         // HACK: Determine if this method is whitelisted and hence we do not perform any validation.
         // We currently insta-UB on anything passing around uninitialized memory, so we have to whitelist
         // the places that are allowed to do that.
+        // The second group is stuff libstd does that is forbidden even under relaxed validation.
         {
             // The regexp we use for filtering
             use regex::Regex;
             lazy_static! {
                 static ref RE: Regex = Regex::new("^(\
-std::mem::uninitialized::|\
-std::mem::forget::|\
-<std::heap::Heap as std::heap::Alloc>::|\
-<std::mem::ManuallyDrop<T>><.*>::new$|\
-<std::mem::ManuallyDrop<T> as std::ops::DerefMut><.*>::deref_mut$|\
-std::ptr::read::\
-)").unwrap();
+                    std::mem::uninitialized::|\
+                    std::mem::forget::|\
+                    <std::heap::Heap as std::heap::Alloc>::|\
+                    <std::mem::ManuallyDrop<T>><.*>::new$|\
+                    <std::mem::ManuallyDrop<T> as std::ops::DerefMut><.*>::deref_mut$|\
+                    std::ptr::read::|\
+                    \
+                    <std::sync::Arc<T>><.*>::inner$|\
+                    <std::sync::Arc<T>><.*>::drop_slow$|\
+                    std::heap::Layout::for_value::|\
+                    std::mem::(size|align)_of_val::\
+                )").unwrap();
             }
             // Now test
             let name = self.stack[self.cur_frame()].instance.to_string();