/// 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
}
#[inline(always)]
- fn ptr_op(
+ fn binary_ptr_op(
ecx: &rustc_mir::interpret::InterpCx<'mir, 'tcx, Self>,
bin_op: mir::BinOp,
left: ImmTy<'tcx, Tag>,
right: ImmTy<'tcx, Tag>,
) -> InterpResult<'tcx, (Scalar<Tag>, bool)> {
- ecx.ptr_op(bin_op, left, right)
+ ecx.binary_ptr_op(bin_op, left, right)
}
fn box_alloc(
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))
}