From de10839f96e0aaa7abe7de540c9f2fa5e59eab1f Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Fri, 18 Mar 2016 12:11:57 -0600 Subject: [PATCH] Avoid an integer underflow error. --- src/memory.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)