Skip to content

Commit

Permalink
operand-to-place copies should never be overlapping
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Feb 9, 2019
1 parent 312f382 commit a01efbc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc_mir/interpret/place.rs
Expand Up @@ -823,6 +823,8 @@ where
let src = match self.try_read_immediate(src)? {
Ok(src_val) => {
// Yay, we got a value that we can write directly.
// FIXME: Add a check to make sure that if `src` is indirect,
// it does not overlap with `dest`.
return self.write_immediate_no_validate(src_val, dest);
}
Err(mplace) => mplace,
Expand All @@ -836,7 +838,8 @@ where
self.memory.copy(
src_ptr, src_align,
dest_ptr, dest_align,
dest.layout.size, false
dest.layout.size,
/*nonoverlapping*/ true,
)?;

Ok(())
Expand Down

0 comments on commit a01efbc

Please sign in to comment.