diff --git a/src/memory.rs b/src/memory.rs index c563e84a90c5..6878fbdce6b0 100644 --- a/src/memory.rs +++ b/src/memory.rs @@ -119,7 +119,8 @@ pub fn copy(&mut self, src: Pointer, dest: Pointer, size: usize) -> EvalResult<( for &mut (ref mut offset, _) in &mut relocations { alloc.relocations.remove(offset); - *offset += dest.offset - src.offset; + *offset += dest.offset; + *offset -= src.offset; } (bytes, relocations)