mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 22:18:23 +03:00
Avoid an integer underflow error.
This commit is contained in:
+2
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user