Closed
Description
This was introduces in this commit:
907cfb2
For example:
stdarch/crates/core_arch/src/aarch64/neon/mod.rs
Line 1129 in 89b0e35
pub unsafe fn vst1q_f64(ptr: *mut f64, a: float64x2_t) {
copy_nonoverlapping(
&a as *const float64x2_t as *const f64,
ptr as *mut f64,
size_of::<float64x2_t>(),
)
}
The docs for copy_nonoverlapping says "Copies count * size_of::() bytes from src to dst"
The example above will get called with type T = f64 (with size 8 bytes), and count = size_of::<float64x2_t> = 16. So it will end up copying 8*16=128 bytes. That's quite a bit more than the 16 bytes it should have been.
The result is that it writes garbage to memory locations it should not touch.
https://doc.rust-lang.org/core/ptr/fn.copy_nonoverlapping.html
Metadata
Metadata
Assignees
Labels
No labels