Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

sdk: Use u32::MAX from std to unbreak BPF builds (bp #16171) #16172

Merged
merged 1 commit into from
Mar 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/program/src/short_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ fn visit_byte(elem: u8, val: u16, nth_byte: usize) -> VisitResult {
}

let shift = u32::try_from(nth_byte)
.unwrap_or(u32::MAX)
.unwrap_or(std::u32::MAX)
.saturating_mul(7);
let elem_val = elem_val.checked_shl(shift).unwrap_or(u32::MAX);
let elem_val = elem_val.checked_shl(shift).unwrap_or(std::u32::MAX);

let new_val = val | elem_val;
let val = u16::try_from(new_val).map_err(|_| VisitError::Overflow(new_val))?;
Expand Down