separate bounds-check from alignment check

This commit is contained in:
Ralf Jung
2023-09-26 21:08:21 +02:00
parent e24835c6e0
commit b131fc10ae
13 changed files with 93 additions and 140 deletions

View File

@@ -7,7 +7,6 @@ use either::Either;
use rustc_middle::mir;
use rustc_middle::mir::interpret::{InterpResult, Scalar};
use rustc_middle::ty::layout::LayoutOf;
use rustc_target::abi::Align;
use super::{ImmTy, InterpCx, Machine, Projectable};
use crate::util;
@@ -210,9 +209,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
// No alignment requirement since `copy_op` above already checked it.
self.mem_copy_repeatedly(
first_ptr,
Align::ONE,
rest_ptr,
Align::ONE,
elem_size,
length - 1,
/*nonoverlapping:*/ true,