Allow ptr_from_addr_cast to fail
This commit is contained in:
parent
4322a785cc
commit
e1f0736927
2 changed files with 7 additions and 6 deletions
|
@ -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())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue