-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A &Header cannot be used to get a useful pointer to data beyond it, because the provenance of the pointer from the as-cast of the &Header only has provenance over the Header. After a set_len call that shrinks the slice, it is invalid to create a slice then try to get_unchecked into the region between the old and new length, because the reference in the slice that the ThinVec now Derefs to does not have provenance over that region. Also misaligned data pointers were produce when the gecko-ffi feature was enabled and T has an alignment greater than 4. And the use of align_offset in tests is subtly wrong, align_offset is for optimizations only. The docs say that a valid implementation may always return usize::MAX.
- Loading branch information
Showing
1 changed file
with
21 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters