the alignment checks on access can no longer fail now
This commit is contained in:
parent
5800bec223
commit
3677c5be56
2 changed files with 10 additions and 4 deletions
|
|
@ -238,7 +238,9 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
return Ok(None);
|
||||
}
|
||||
|
||||
let ptr = match self.check_mplace_access(mplace, None)? {
|
||||
let ptr = match self.check_mplace_access(mplace, None)
|
||||
.expect("places should be checked on creation")
|
||||
{
|
||||
Some(ptr) => ptr,
|
||||
None => return Ok(Some(ImmTy { // zero-sized type
|
||||
imm: Immediate::Scalar(Scalar::zst().into()),
|
||||
|
|
|
|||
|
|
@ -763,7 +763,9 @@ where
|
|||
// to handle padding properly, which is only correct if we never look at this data with the
|
||||
// wrong type.
|
||||
|
||||
let ptr = match self.check_mplace_access(dest, None)? {
|
||||
let ptr = match self.check_mplace_access(dest, None)
|
||||
.expect("places should be checked on creation")
|
||||
{
|
||||
Some(ptr) => ptr,
|
||||
None => return Ok(()), // zero-sized access
|
||||
};
|
||||
|
|
@ -866,8 +868,10 @@ where
|
|||
});
|
||||
assert_eq!(src.meta, dest.meta, "Can only copy between equally-sized instances");
|
||||
|
||||
let src = self.check_mplace_access(src, Some(size))?;
|
||||
let dest = self.check_mplace_access(dest, Some(size))?;
|
||||
let src = self.check_mplace_access(src, Some(size))
|
||||
.expect("places should be checked on creation");
|
||||
let dest = self.check_mplace_access(dest, Some(size))
|
||||
.expect("places should be checked on creation");
|
||||
let (src_ptr, dest_ptr) = match (src, dest) {
|
||||
(Some(src_ptr), Some(dest_ptr)) => (src_ptr, dest_ptr),
|
||||
(None, None) => return Ok(()), // zero-sized copy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue