Remove a wrong multiplier on relocation offset computation

This commit is contained in:
Oliver Scherer 2018-12-17 16:47:26 +01:00
parent 640c7ff432
commit 3e7a4ca2f1
2 changed files with 13 additions and 4 deletions

View File

@ -707,10 +707,10 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
new_relocations.extend(
relocations
.iter()
.map(|&(offset, reloc)| {
(offset + dest.offset - src.offset + (i * size * relocations.len() as u64),
reloc)
})
.map(|&(offset, reloc)| (
offset + dest.offset - src.offset + (i * size),
reloc,
))
);
}

View File

@ -0,0 +1,9 @@
// compile-pass
fn main() {
let _ = &[("", ""); 3];
}
const FOO: &[(&str, &str)] = &[("", ""); 3];
const BAR: &[(&str, &str); 5] = &[("", ""); 5];
const BAA: &[[&str; 12]; 11] = &[[""; 12]; 11];