mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 12:13:43 +00:00
Remove a wrong multiplier on relocation offset computation
This commit is contained in:
parent
640c7ff432
commit
3e7a4ca2f1
@ -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,
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
|
9
src/test/ui/consts/promoted_regression.rs
Normal file
9
src/test/ui/consts/promoted_regression.rs
Normal 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];
|
Loading…
Reference in New Issue
Block a user