make execution with full MIR work: need to whitelist Arc drop impl and whatever it calls

This commit is contained in:
Ralf Jung 2017-08-01 20:41:17 -07:00
parent c2c05014af
commit 85dc3e563e

View File

@ -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();