1
Fork 0

ptr::copy: fix docs for the overlapping case

This commit is contained in:
Ralf Jung 2024-12-21 08:32:47 +01:00
parent 13170cd787
commit 526d29865c
2 changed files with 5 additions and 5 deletions

View file

@ -1359,6 +1359,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
let src_alloc = self.get_alloc_raw(src_alloc_id)?;
let src_range = alloc_range(src_offset, size);
assert!(!self.memory.validation_in_progress, "we can't be copying during validation");
// For the overlapping case, it is crucial that we trigger the read hook
// before the write hook -- the aliasing model cares about the order.
M::before_memory_read(
tcx,
&self.machine,