Skip to content

Commit

Permalink
underflow/overflow assertion should be <=
Browse files Browse the repository at this point in the history
  • Loading branch information
venomousmoog committed Mar 4, 2025
1 parent ee4b9ca commit d548dd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ unsafe fn owned_drop_impl(owned: *mut ()) {

let old_cnt = ref_cnt.fetch_sub(1, Ordering::Release);
debug_assert!(
old_cnt > 0 && old_cnt < usize::MAX >> 1,
old_cnt > 0 && old_cnt <= usize::MAX >> 1,
"expected non-zero refcount and no underflow"
);
if old_cnt != 1 {
Expand Down

0 comments on commit d548dd0

Please sign in to comment.