Allow ptr_from_addr_cast to fail

This commit is contained in:
Ralf Jung 2022-06-05 10:53:35 -04:00
parent 4322a785cc
commit e1f0736927
2 changed files with 7 additions and 6 deletions

View file

@ -221,7 +221,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
let addr = addr.to_machine_usize(self)?;
// Then turn address into pointer.
let ptr = M::ptr_from_addr_cast(&self, addr);
let ptr = M::ptr_from_addr_cast(&self, addr)?;
Ok(Scalar::from_maybe_pointer(ptr, self).into())
}