From 85dc3e563ea52f54e57f1a1f2422c54c3680e2ec Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 1 Aug 2017 20:41:17 -0700 Subject: [PATCH] make execution with full MIR work: need to whitelist Arc drop impl and whatever it calls --- src/librustc_mir/interpret/validation.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/librustc_mir/interpret/validation.rs b/src/librustc_mir/interpret/validation.rs index a6c2871cf521..4454e21b1aac 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::|\ -::|\ -><.*>::new$|\ - as std::ops::DerefMut><.*>::deref_mut$|\ -std::ptr::read::\ -)").unwrap(); + std::mem::uninitialized::|\ + std::mem::forget::|\ + ::|\ + ><.*>::new$|\ + as std::ops::DerefMut><.*>::deref_mut$|\ + std::ptr::read::|\ + \ + ><.*>::inner$|\ + ><.*>::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();