make miri compile again

This commit is contained in:
Ralf Jung 2018-07-24 22:20:50 +02:00 committed by Oliver Schneider
parent 53114e3b36
commit e849fa47fb
2 changed files with 2 additions and 1 deletions

View File

@ -344,7 +344,7 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'mir, 'tcx, super:
ty::layout::Abi::Scalar(_) => Value::Scalar(Scalar::null()),
_ => {
// FIXME(oli-obk): pass TyLayout to alloc_ptr instead of Ty
let ptr = this.alloc_ptr(dest_layout.ty)?;
let ptr = this.alloc_ptr(dest_layout)?;
let ptr = Scalar::Ptr(ptr);
this.memory.write_repeat(ptr, 0, size)?;
Value::ByRef(ptr, dest_layout.align)

View File

@ -140,6 +140,7 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, '
mir::Place::Static(ref s) => AbsPlace::Static(s.def_id),
mir::Place::Projection(ref p) =>
AbsPlace::Projection(Box::new(self.abstract_place_projection(&*p)?)),
_ => unimplemented!("validation is not currently maintained"),
})
}