/// TLS state.
pub(crate) tls: TlsData<'tcx>,
+
+ /// If enabled, the `env_vars` field is populated with the host env vars during initialization.
+ pub(crate) communicate: bool,
}
impl<'tcx> Evaluator<'tcx> {
- pub(crate) fn new() -> Self {
+ pub(crate) fn new(communicate: bool) -> Self {
Evaluator {
env_vars: HashMap::default(),
argc: None,
cmd_line: None,
last_error: 0,
tls: TlsData::default(),
+ communicate,
}
}
}
const STATIC_KIND: Option<MiriMemoryKind> = Some(MiriMemoryKind::Static);
+ const CHECK_ALIGN: bool = true;
+
#[inline(always)]
fn enforce_validity(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
ecx.memory().extra.validate
let data = vec![0; size.bytes() as usize];
Allocation::from_bytes(&data, tcx.data_layout.pointer_align.abi)
}
- _ => throw_unsup!(Unimplemented(
- format!("can't access foreign static: {}", link_name),
- )),
+ _ => throw_unsup_format!("can't access foreign static: {}", link_name),
};
Ok(Cow::Owned(alloc))
}