Closed
Description
The problematic function:
fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
unsafe {
let self2: &mut [T] = mem::transmute_copy(&self);
(ops::IndexMut::index_mut(self, ops::RangeTo { end: mid } ),
ops::IndexMut::index_mut(self2, ops::RangeFrom { start: mid } ))
}
}
the first field return value is very much alive when index_mut
is called on self2
. This doesn't strictly violate LLVM's aliasing rules (AFAICT), because the overlapping part isn't directly accessed, but is still very sketchy (I can think of optimizers screwing it up).
Metadata
Metadata
Assignees
Labels
No labels