Skip to content

Commit

Permalink
fix(rust): properly check the BMI2 uleb128 (#17191)
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite authored Jun 25, 2024
1 parent 7a1be3b commit 332e40a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/polars-parquet/src/parquet/encoding/uleb128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ pub fn decode(values: &[u8]) -> (u64, usize) {
#[cfg(target_feature = "bmi2")]
{
if polars_utils::cpuid::has_fast_bmi2() && values.len() >= 8 {
return unsafe { decode_uleb_bmi2(values) };
let (result, consumed) = unsafe { decode_uleb_bmi2(values) };
if consumed <= 8 {
return (result, consumed);
}
}
}

Expand Down

0 comments on commit 332e40a

Please sign in to comment.