diff --git a/src/eval.rs b/src/eval.rs index 7a3945220f..bc989ce469 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -53,6 +53,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>( StdRng::seed_from_u64(config.seed.unwrap_or(0)), config.validate, config.tracked_pointer_tag, + Scalar::from_int(0, tcx.data_layout.pointer_size), ), ); // Complete initialization. diff --git a/src/machine.rs b/src/machine.rs index f8c7168a58..21414c9457 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -78,15 +78,22 @@ pub struct MemoryExtra { /// Whether to enforce the validity invariant. pub(crate) validate: bool, + + environ: Scalar, } impl MemoryExtra { - pub fn new(rng: StdRng, validate: bool, tracked_pointer_tag: Option) -> Self { + pub fn new( + rng: StdRng, validate: bool, + tracked_pointer_tag: Option, + environ: Scalar + ) -> Self { MemoryExtra { stacked_borrows: Rc::new(RefCell::new(GlobalState::new(tracked_pointer_tag))), intptrcast: Default::default(), rng: RefCell::new(rng), validate, + environ, } } } @@ -266,6 +273,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> { fn find_foreign_static( tcx: TyCtxt<'tcx>, def_id: DefId, + _memory_extra: &MemoryExtra, ) -> InterpResult<'tcx, Cow<'tcx, Allocation>> { let attrs = tcx.get_attrs(def_id); let link_name = match attr::first_attr_value_str_by_name(&attrs, sym::link_name) {