]> git.lizzy.rs Git - rust.git/commitdiff
Fix bug in relocation ranges.
authorScott Olson <scott@solson.me>
Mon, 13 Jun 2016 02:42:08 +0000 (20:42 -0600)
committerScott Olson <scott@solson.me>
Mon, 13 Jun 2016 02:42:08 +0000 (20:42 -0600)
src/memory.rs

index ab527a47c0bf5cbb57088e54ffa7fae6bfd5288d..be47e9c9da72a5ac8686d4c0ad07a9ba4e981f98 100644 (file)
@@ -357,7 +357,7 @@ fn relocations(&self, ptr: Pointer, size: usize)
         -> EvalResult<btree_map::Range<usize, AllocId>>
     {
         let start = ptr.offset.saturating_sub(self.pointer_size - 1);
-        let end = start + size;
+        let end = ptr.offset + size;
         Ok(self.get(ptr.alloc_id)?.relocations.range(Included(&start), Excluded(&end)))
     }