Closed
Description
Expects the following function to always return true since it's undefined behaviour otherwise.
use std::ptr;
pub unsafe fn test(s: &Vec<&[i32]>, idx: usize) -> bool {
unsafe { Some(ptr::read(s.as_ptr().add(idx))).is_some() }
}
Actual result:
example::test:
mov rax, qword ptr [rdi + 8]
shl rsi, 4
cmp qword ptr [rax + rsi], 0
setne al
ret