the prefetch is public accessible, and the offset does not have the appropriate check, which can cause user/developer might causing memory issue by merely using safe API.
|
pub fn prefetch<T>(data: &[T], offset: usize) { |
|
use core::arch::x86_64::_mm_prefetch; |
|
unsafe { |
|
_mm_prefetch( |
|
data.as_ptr().add(offset) as *const i8, |
|
core::arch::x86_64::_MM_HINT_T0, |
|
); |
|
} |
Suggestion:
- notify rustsec for this issue
- mark it as unsafe to notify developer that this function might have memory risks
the prefetch is public accessible, and the offset does not have the appropriate check, which can cause user/developer might causing memory issue by merely using safe API.
halo2curves/src/lib.rs
Lines 33 to 40 in ee35b4e
Suggestion: