Skip to content

Commit

Permalink
fix: invalid check for bvector with 64 dims (#444)
Browse files Browse the repository at this point in the history
Signed-off-by: Mingzhuo Yin <yinmingzhuo@gmail.com>
  • Loading branch information
silver-ymz authored Mar 22, 2024
1 parent 0056d67 commit fcf2da1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/base/src/vector/bvecf32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ impl<'a> BVecf32Borrowed<'a> {
if data.len() != (dims as usize).div_ceil(BVEC_WIDTH) {
return None;
}
if data[data.len() - 1] >> (dims % BVEC_WIDTH as u16) != 0 {
if dims % BVEC_WIDTH as u16 != 0 && data[data.len() - 1] >> (dims % BVEC_WIDTH as u16) != 0
{
return None;
}
unsafe { Some(Self::new_unchecked(dims, data)) }
Expand Down

0 comments on commit fcf2da1

Please sign in to comment.