diff --git a/src/memory.rs b/src/memory.rs index c563e84a90c..6878fbdce6b 100644 --- a/src/memory.rs +++ b/src/memory.rs @@ -119,7 +119,8 @@ impl Memory { 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)